Skip to content

Commit

Permalink
Fix combobox focus from being lost when filtering large collections (a…
Browse files Browse the repository at this point in the history
  • Loading branch information
LFDanLu committed Aug 20, 2024
1 parent 1067aff commit 64e4a40
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ export function useSelectableCollection(options: AriaSelectableCollectionOptions
}

// If the focused key becomes null (e.g. the last item is deleted), focus the whole collection.
if (manager.isFocused && manager.focusedKey == null && lastFocusedKey.current != null) {
if (!shouldUseVirtualFocus && manager.isFocused && manager.focusedKey == null && lastFocusedKey.current != null) {
focusSafely(ref.current);
}

Expand Down

0 comments on commit 64e4a40

Please sign in to comment.