Skip to content

Commit 64e4a40

Browse files
authored
Fix combobox focus from being lost when filtering large collections (#6913)
1 parent 1067aff commit 64e4a40

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/@react-aria/selection/src/useSelectableCollection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ export function useSelectableCollection(options: AriaSelectableCollectionOptions
424424
}
425425

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

0 commit comments

Comments
 (0)