v0.136.1
Patch Changes
-
#1156
0af1eff8Thanks @tenphi! - Fix focus management for popover-based components (Menu,Select,FilterPicker,Picker) opening inside a containedDialog.Previously, when a popover-based component opened inside an outer popover/modal
Dialog(whoseFocusScopecontains focus), focus would land on the popover<section>itself or stay on the trigger button instead of moving to the appropriate element inside the popover (search input, first option, first menu item).Three independent fixes:
Dialog— now re-promotes focus to a priority element (input[data-autofocus],button[type="submit"],button[data-type="primary"]) when the dialog<section>itself is the active element. This recovers from a race between React's nativeautoFocus(mutation phase) and react-aria's focus-scope tree registration (layout phase). FixesFilterPicker/Pickersearch inputs.Menu(MenuTrigger) — its popover content is now wrapped in a<FocusScope restoreFocus>so the menu items register as a child scope of any outer containedFocusScope. Without this, the outer scope rejects focus moving into the menu items (in a portal, with no registered child scope) and yanks focus back to the menu trigger.Select— its inner<FocusScope>now also hasautoFocus. Select's listbox subtree is mounted unconditionally, so react-aria'suseSelectableCollectionautoFocus is consumed once on mount when the listbox isn't yet in the DOM. TheFocusScopeautoFocusruns each time the popover opens (the inner tree unmounts between opens) and explicitly focuses the listbox. The listbox<ul>also getsoutline: 0so it never displays the browser's native focus ring (only the focused option does).
-
#1155
22041efbThanks @solarrust! - ListBox: show drag handle on hover when item has a custom icon; remove danger theme from TabPicker close action