fix(desktop): jankiness

This commit is contained in:
Adam 2025-12-29 09:47:53 -06:00
commit 831e9bce51
No known key found for this signature in database
GPG key ID: 9CB48779AF150E75
8 changed files with 69 additions and 60 deletions

View file

@ -51,9 +51,17 @@ export function useFilteredList<T>(props: FilteredListProps<T>) {
)
})
function initialActive() {
if (props.current) return props.key(props.current)
const items = flat()
if (items.length === 0) return ""
return props.key(items[0])
}
const list = createList({
items: () => flat().map(props.key),
initialActive: props.current ? props.key(props.current) : props.key(flat()[0]),
initialActive: initialActive(),
loop: true,
})