diff options
| author | OpeOginni <[email protected]> | 2026-01-13 15:16:57 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-01-13 08:16:57 -0600 |
| commit | 736cd10847c4af2e4ef9ba7b9eadd1e6352ff2f9 (patch) | |
| tree | d3ec5e8dadbc61f64bf7dce9dbedeb794c295514 /packages | |
| parent | a03daa42526f55cbab64cb9bf3407111b899f16b (diff) | |
| download | opencode-736cd10847c4af2e4ef9ba7b9eadd1e6352ff2f9.tar.gz opencode-736cd10847c4af2e4ef9ba7b9eadd1e6352ff2f9.zip | |
fix(ui): track memo-based items in useFilteredList without affecting async function based lists (#8216)
Co-authored-by: neriousy <[email protected]>
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/ui/src/hooks/use-filtered-list.tsx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/ui/src/hooks/use-filtered-list.tsx b/packages/ui/src/hooks/use-filtered-list.tsx index 1b3be4b4c..e265fffef 100644 --- a/packages/ui/src/hooks/use-filtered-list.tsx +++ b/packages/ui/src/hooks/use-filtered-list.tsx @@ -24,7 +24,11 @@ export function useFilteredList<T>(props: FilteredListProps<T>) { const [grouped, { refetch }] = createResource( () => ({ filter: store.filter, - items: typeof props.items === "function" ? undefined : props.items, + items: typeof props.items === "function" + ? props.items.length === 0 + ? (props.items as () => T[])() + : undefined + : props.items, }), async ({ filter, items }) => { const needle = filter?.toLowerCase() |
