Renamed offscreenBehavior to offscreenMode
BREAKING if you're using the offscreenBehavior prop on collection or composite item offscreen components.
The offscreenBehavior prop has been renamed to offscreenMode for consistency.
Before:
<ComboboxItem offscreenBehavior="lazy" />After:
<ComboboxItem offscreenMode="lazy" />Clicking outside no longer restores focus to the disclosure element
Dialog and components that extend it (such as Menu and Popover) no longer restore focus to the disclosure element when the dialog is closed by clicking or right-clicking outside. This aligns with native HTML <dialog> and popover behavior where trigger buttons don't receive focus when you interact outside.
Focus is still restored normally when the dialog is closed by other means, such as pressing Escape, selecting a menu item, or calling store.hide() programmatically. In these cases the disclosure element is now focused with default browser scrolling instead of preventScroll.
Improved Safari focus behavior for buttons, checkboxes, and radio buttons
On Safari, buttons, checkboxes, and radio buttons don't receive focus on mousedown like other browsers. Previously, this was handled by manually focusing the element in a mousedown handler. Now, an explicit tabIndex attribute is set on these elements in Safari, which causes the browser to focus them natively. This results in more predictable focus behavior and fewer timing-sensitive workarounds.
Other updates
- Fixed a race condition in
Dialogwhere the deferred auto-focus could steal focus from the disclosure element after the dialog was closed. - Fixed
formStore.setError()andformStore.setFieldTouched()failing to set values on nested array field paths such asitems.0.name. - Fixed
SelectItemstore itemchildrenproperty reflecting thevalueprop instead of the actual rendered text content. - Fixed
MenuButtonto preserveaccessibleWhenDisabledbehavior when composed with a renderedButton. - Fixed
MenuwithmodalandgetPersistentElementsso focusing a persistentMenuButtondoesn't immediately move focus back to the menu. - Fixed
useMetadataPropsoverwriting parent metadata withundefinedwhen the child doesn't provide an explicit value. - Fixed
TabPanelnot re-evaluating tabbable children when the panel becomes visible. - Fixed components not dropping their internal
aria-labelledbywhenaria-labelis passed. - Updated dependencies:
@ariakit/core@0.4.19