diff options
| author | David Hill <[email protected]> | 2026-01-24 20:51:53 +0000 |
|---|---|---|
| committer | David Hill <[email protected]> | 2026-01-24 22:02:08 +0000 |
| commit | 02aea77e9249af5701a29a06adf47e47cedf84f3 (patch) | |
| tree | 797a3aaf12229b0961ff17558caa2a2b0a99beca /packages/ui/src/hooks | |
| parent | a98add29d1b5d5f834a69b0e25156d0f301a6ec8 (diff) | |
| download | opencode-02aea77e9249af5701a29a06adf47e47cedf84f3.tar.gz opencode-02aea77e9249af5701a29a06adf47e47cedf84f3.zip | |
feat(app): update manage servers dialog styling and behavior
Diffstat (limited to 'packages/ui/src/hooks')
| -rw-r--r-- | packages/ui/src/hooks/use-filtered-list.tsx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/packages/ui/src/hooks/use-filtered-list.tsx b/packages/ui/src/hooks/use-filtered-list.tsx index e418b55d5..2d4e2bdd1 100644 --- a/packages/ui/src/hooks/use-filtered-list.tsx +++ b/packages/ui/src/hooks/use-filtered-list.tsx @@ -13,6 +13,7 @@ export interface FilteredListProps<T> { sortBy?: (a: T, b: T) => number sortGroupsBy?: (a: { category: string; items: T[] }, b: { category: string; items: T[] }) => number onSelect?: (value: T | undefined, index: number) => void + noInitialSelection?: boolean } export function useFilteredList<T>(props: FilteredListProps<T>) { @@ -57,6 +58,7 @@ export function useFilteredList<T>(props: FilteredListProps<T>) { }) function initialActive() { + if (props.noInitialSelection) return "" if (props.current) return props.key(props.current) const items = flat() @@ -71,6 +73,10 @@ export function useFilteredList<T>(props: FilteredListProps<T>) { }) const reset = () => { + if (props.noInitialSelection) { + list.setActive("") + return + } const all = flat() if (all.length === 0) return list.setActive(props.key(all[0])) |
