You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/@react-aria/autocomplete/src/useAutocomplete.ts
+7-4Lines changed: 7 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -231,12 +231,15 @@ export function useAutocomplete<T>(props: AriaAutocompleteOptions<T>, state: Aut
231
231
// Backspace shouldn't trigger tag deletion either
232
232
return;
233
233
case'Tab':
234
-
// Don't propogate Tab down to the collection, otherwise we will try to focus the collection via useSelectableCollection's Tab handler (aka shift tab logic)
235
-
// We want FocusScope to handle Tab if one exists (aka sub dialog), so special casepropogate
236
-
if('continuePropagation'ine){
234
+
// Propagate Tab down to the collection so that tabbing foward will hit our special logic to treat the collection
235
+
// as a single tab stop. We want FocusScope to handle Shift Tab if one exists (aka sub dialog), so special case propogate
236
+
// Otherwise, we don't want useSeletableCollection to handle that anyways since focus is actually on an input outside the
237
+
// wrapped collection and thus the browser can handle that for us
// TODO the below check on getVirtuallyFocusedElement isn't accurate because at this point when focus is called, the virtually focused element
76
+
// that we detect is still the old one and thus we cant really distinguish if the element recieveing focus here will be the newly virtually focused element
77
+
// or if we are outside the component using virtual focus and focus is landing on something else? Maybe that doesn't matter since if we are landing on
78
+
// an element with real focus outside the component using virtual focus, then activeElement === getEventTarget(e.nativeEvent) resolves as true
0 commit comments