mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-30 21:49:53 +00:00
fix(app): select first item when filtering
This commit is contained in:
parent
2d52a461a0
commit
4e1b6b3417
1 changed files with 7 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
import fuzzysort from "fuzzysort"
|
import fuzzysort from "fuzzysort"
|
||||||
import { entries, flatMap, groupBy, map, pipe } from "remeda"
|
import { entries, flatMap, groupBy, map, pipe } from "remeda"
|
||||||
import { createMemo, createResource } from "solid-js"
|
import { createEffect, createMemo, createResource, on } from "solid-js"
|
||||||
import { createStore } from "solid-js/store"
|
import { createStore } from "solid-js/store"
|
||||||
import { createList } from "solid-list"
|
import { createList } from "solid-list"
|
||||||
|
|
||||||
|
|
@ -86,9 +86,14 @@ export function useFilteredList<T>(props: FilteredListProps<T>) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
createEffect(
|
||||||
|
on(grouped, () => {
|
||||||
|
reset()
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
|
||||||
const onInput = (value: string) => {
|
const onInput = (value: string) => {
|
||||||
setStore("filter", value)
|
setStore("filter", value)
|
||||||
reset()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue