Add coexistence checks to all enqueue methods to prevent loading both React and Grid.js assets simultaneously. Changes: - ReactAdmin.php: Only enqueue React assets when ?react=1 - Init.php: Skip Grid.js when React active on admin pages - Form.php, Coupon.php, Access.php: Restore classic assets when ?react=0 - Customer.php, Product.php, License.php: Add coexistence checks Now the toggle between Classic and React versions works correctly. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
52 KiB
@ariakit/react-core
0.3.14
- Fixed a regression introduced in
v0.3.13where dialogs wouldn't close when clicking outside on iOS.
0.3.13
Improved performance of large collections
Components like MenuItem, ComboboxItem, and SelectItem should now offer improved performance when rendering large collections.
New FormControl component
This version introduces a new FormControl component. In future versions, this will replace the FormField component.
Other updates
- Adjusted the focus behavior in Safari to occur prior to the
pointerupevent instead ofmouseup. - Improved JSDocs.
- Updated dependencies:
@ariakit/core@0.3.11
0.3.12
- The auto-select feature on Combobox now resets with each keystroke.
- Fixed
Comboboxwith theautoSelectprop callingonFocuswith every input change. - Fixed
Hovercardflickering when used with shadow DOM. - Fixed
SelectwithComboboxscroll jumping when opening using keyboard navigation. - Fixed
CompositeItemtriggering blur on focus. - Fixed
ComboboxItemnot triggering theonClickevent when the item is partially visible. - Improved JSDocs.
- Updated dependencies:
@ariakit/core@0.3.10
0.3.11
Modal Combobox
The Combobox components now support the modal prop on ComboboxPopover.
When a modal combobox is expanded, users can interact with and tab through all the combobox controls, including Combobox, ComboboxDisclosure, and ComboboxCancel, even if they're rendered outside the popover. The rest of the page will be inert.
Controlling the auto-select functionality of Combobox
The Combobox component now includes a new getAutoSelectId prop. This allows you to specify the ComboboxItem that should be auto-selected if the autoSelect prop is true.
By default, the first enabled item is auto-selected. Now you can customize this behavior by returning the id of another item from getAutoSelectId:
<Combobox
autoSelect
getAutoSelectId={(items) => {
// Auto select the first enabled item with a value
const item = items.find((item) => {
if (item.disabled) return false;
if (!item.value) return false;
return true;
});
return item?.id;
}}
/>
Styling Combobox without an active descendant
The Combobox component now includes a data-active-item attribute when it's the only active item in the composite widget. In other words, when no ComboboxItem is active and the focus is solely on the combobox input.
You can use this as a CSS selector to style the combobox differently, providing additional affordance to users who pressed ↑ on the first item or ↓ on the last item. This action would place both virtual and actual DOM focus on the combobox input.
.combobox[data-active-item] {
outline-width: 2px;
}
Other updates
- Fixed
useTabStorereturn value not updating its own reference. - Fixed keyboard navigation on Combobox when the content element is a grid.
- Fixed
ComboboxDisclosureto update itsaria-expandedattribute when the combobox expands. - Fixed
Maximum update depth exceededwarning when rendering multiple collection items on the page. - Improved JSDocs.
- Updated dependencies:
@ariakit/core@0.3.9
0.3.10
Overwriting aria-selected value on ComboboxItem
It's now possible to pass a custom aria-selected value to the ComboboxItem component, overwriting the internal behavior.
Limiting slide on popovers
When components like Popover and Menu with the slide prop are positioned to the right or left of the anchor element, they will now cease to slide across the screen, disengaged from the anchor element, upon reaching the edge of said element.
Other updates
- Fixed
blurOnHoverEndset tofalsenot keeping submenus open. - Fixed scroll jump on Safari when selecting a
CompositeItem. - Fixed
preserveTabOrderAnchoron nested menus. - Fixed focus behavior when using the
preserveTabOrderprop.
0.3.9
Automatic role on ComboboxGroup
The ComboboxGroup component now automatically assigns the role attribute as rowgroup if it's nestled within a ComboboxPopover or ComboboxList wrapper that has the role attribute set to grid.
Custom submenu auto focus
When opening nested Menu components with Enter, Space, or arrow keys, the first tabbable element will now receive focus, even if it's not a MenuItem element. This should enable custom popups that behave like submenus, but use different semantics.
Hovercard display timeout
The Hovercard, Menu, and Tooltip components now display synchronously when the timeout or showTimeout states are set to 0. This should stop submenus from vanishing for a few frames prior to displaying a new menu when hovering over menu items in sequence.
Other updates
- Fixed
CollectionItemelements getting out of order when composing stores. - Fixed
MenuButtonnot assigning the correctroleattribute when used within aComboboxListelement. - Fixed
MenuItemwith an explicitfocusOnHoverprop not moving focus properly. - Fixed
blurOnHoverEndnot working on submenu triggers. - Fixed Dialog not respecting the controlled
openstate. - Fixed unmounted
SelectPopovernot re-opening when itsopenstate is initially set totrue. - Fixed TypeScript build errors.
- Fixed focus order when using Popover with the
portalprop with VoiceOver. - Updated dependencies:
@ariakit/core@0.3.8
0.3.8
Multi-selectable Combobox
We've added support for the Combobox with multiple selection capabilities using a new selectedValue prop, along with defaultSelectedValue and setSelectedValue.
This works similarly to the value prop on Select components. If it receives an array, the combobox will allow multiple selections. By default, it's a string that represents the selected value in a single-select combobox.
Check out the Multi-selectable Combobox example to see it in action.
New Combobox components
This version introduces new Combobox components:
ComboboxLabel: This renders alabelelement for aCombobox, with thehtmlForprop set automatically.ComboboxItemCheck: This displays a checkmark for aComboboxItemwhen the item is selected.
Other updates
- Added
resetValueOnSelectstate to Combobox components. - Added
selectValueOnClickprop toComboboxItem. - Fixed
SelectItemrendering anaria-selectedattribute even when thevalueprop is omitted. - Updated dependencies:
@ariakit/core@0.3.7
0.3.7
Expanding Menubar
The Menubar component will now only expand if there's another menu already expanded in the same menubar.
Internal data attribute changes
Just like the change in v0.3.6 that removed the data-command and data-disclosure attributes from elements, this update stops the data-composite-hover attribute from infiltrating composite item elements in the DOM. We're mentioning this in the changelog as some users might have snapshot tests that require updating.
Other updates
- Fixed
setSelectionRangeerror when used with unsupported input types. - Fixed
MenuButtonwithshowOnHovernot updating theactiveIdstate when hovered. - Updated
onFocusVisibleelement type onFocusablefromElementtoHTMLElement. - Updated dependencies:
@ariakit/core@0.3.6
0.3.6
Data attributes for duplicate components
The internal logic that identifies duplicate components has been refined. This implies that some internal data-* attributes will no longer seep into the rendered DOM elements. If you're doing snapshot tests on the DOM generated by Ariakit components, you should see the data-command and data-disclosure attributes removed.
Multiple disclosure and anchor elements
The disclosureElement and anchorElement states on Disclosure, Popover, and Menu, along with related components, are now set only upon interaction.
This change enables us to support multiple disclosure/anchor elements for the same contentElement (typically the popup element) when triggered by hover or focus.
Expanding Menubar with focus
Adjacent Menu popups will now open when the focus moves through MenuItem elements in a Menubar. Before, they would only open when another Menu was already visible.
Maintaining Popover tab order
Popover and related components now automatically set the new preserveTabOrderAnchor prop as the disclosure element.
This ensures that, when the portal prop is enabled, the tab order will be preserved from the disclosure to the content element even when the Popover component is rendered in a different location in the React tree.
New Menubar components
This version introduces a new Menubar module that can be used without the MenubarProvider wrapper.
Other updates
- Fixed Hovercard when used with multiple
HovercardAnchorelements. - Added new
preserveTabOrderAnchorprop toPortaland related components. - Added new
tabbableprop toCompositeItemand related components. - Added new
blurOnHoverEndprop toCompositeHoverand related components. - Updated dependencies:
@ariakit/core@0.3.5
0.3.5
Patch Changes
-
#2935Fixed TypeScript declaration files in CommonJS projects usingNodeNextformoduleResolution. -
#2945Addednameandvalueproperties to non-native input elements rendered byCheckbox,Radio,MenuItemCheckbox, andMenuItemRadio.It's now possible to access the
nameandvalueproperties from theevent.targetelement in theonChangeevent handler. -
#2945FixedCompositeItemand associated components not receiving thedisabledprop when it's being used by a higher-level component such asMenuItemCheckboxorMenuItemRadio. -
#2945It's now possible to control the menuvaluesstate by passing thechecked,defaultCheckedandonChangeprops toMenuItemCheckboxandMenuItemRadio. -
#2948Added"use client"directive to all modules. -
#2949The Select component will now display the selected option(s) on the underlying native select element even when the correspondingSelectItemcomponents aren't rendered.This comes in handy when the
SelectPopovercomponent is rendered dynamically (for instance, using theunmountOnHideprop) or adefaultValueis given without a matchingSelectItemcomponent. -
Improved JSDocs.
-
Updated dependencies:
@ariakit/core@0.3.4.
0.3.4
Patch Changes
-
#2894Fixed Command and related components not preventing the default behavior on Space keyup on non-native button elements. -
#2896Controlled store updates are no longer flushed synchronously.Previously, we were wrapping all controlled store updates with
ReactDOM.flushSync. This approach proved to be quite fragile and led to a few problems. Now, we only apply this to specific updates that require synchronous flushing.This change shouldn't impact your application, unless you're already facing problems, which could be fixed by this. If you find any issues stemming from this change, please let us know. Regardless, you can always opt into the previous behavior by wrapping your own updates in
flushSyncwhen needed:const [open, setOpen] = useState(false); useDialogStore({ open, setOpen(open) { ReactDOM.flushSync(() => setOpen(open)); }, }); -
#2897FixedCompositeRenderermissing itsitemsstate when used in a component with amountedstate. -
#2909Fixed Disclosure and related components not waiting for the exit animation to complete before hiding the content element. -
#2909The Dialog and related components can now receive controlledopenandonCloseprops, allowing them to be used without a store:const [open, setOpen] = useState(false); <Dialog open={open} onClose={() => setOpen(false)} > -
#2922AddedunmountOnHideprop toDisclosureContent,Dialogand related components.Conditionally rendering the
Dialogand related components will continue to work as before:open && <Dialog>Now, you can do the same thing using the
unmountOnHideprop:<Dialog unmountOnHide> -
Improved JSDocs.
-
Updated dependencies:
@ariakit/core@0.3.3.
0.3.3
Patch Changes
-
#2820Added missingaria-haspopupattribute toDialogDisclosureandPopoverDisclosure. -
#2858Fixed thesetValueOnMovestate on the Select module not syncing between multiple stores.The following now works as expected:
const store1 = useSelectStore(); const store2 = useSelectStore({ store: store1, setValueOnMove: true }); store1.useState("setValueOnMove") === store2.useState("setValueOnMove"); // true -
#2862Renamed@ariakit/react-core/dialog/utils/disable-tree-outsidemodule to@ariakit/react-core/dialog/utils/disable-tree. -
#2862Elements inside Dialog and derived components are now properly disabled when the dialog is animating out. -
#2862Fixed a bug that occurred when rendering nested Dialog elements with a third-party dialog interspersed.Previously, Ariakit didn't recognize the third-party dialog as a nested dialog when the lowest dialog opened.
-
#2862ThehideOnEscapeprop is now triggered during the capture phase.Essentially, this means that you can now prevent the propagation of the Escape keydown event to other elements in the DOM when it's used to close an Ariakit Dialog:
<Dialog hideOnEscape={(event) => { event.stopPropagation(); return true; }} /> -
#2862Fixed an issue where the Dialog component would automatically hide when parent dialogs closed.You can now render nested dialogs in the React tree and keep them open independently, provided they're not unmounted.
-
#2862Fixed the Focusable and its derived components that were incorrectly calling theonFocusVisiblecallback prop when the element had lost focus.This didn't align with the behavior of the
data-focus-visibleattribute. The behavior now mirrors the attribute, which will only be omitted from the element ifevent.preventDefault()is invoked from within theonFocusVisiblecallback. -
#2862Themodalprop is now automatically disabled on nestedMenucomponents. -
#2869Fixed uncaughtmsg.startsWitherror. -
Improved JSDocs.
0.3.2
Patch Changes
-
#2811TypeScript: Fixed missingnulltype on props fromuseMenuStore(combobox,parent,menubar), anduseSelectStore(combobox). -
#2812Fixed an infinite loop issue when usingMenuButtonwith astorethat is synchronized with another store. -
Improved JSDocs.
-
Updated dependencies:
@ariakit/core@0.3.2.
0.3.1
Patch Changes
-
#2797Fixed a regression onDialogregarding the timing of its "focus on hide" behavior. -
#2801Fixedvalues.sliceerror that would occur when clicking onFormCheckboxthat uses an integer-like field name. -
#2802AddedsetMountedprop touseDisclosureStoreand derived component stores. This callback prop can be used to react to changes in themountedstate. For example:useDialogStore({ setMounted(mounted) { if (!mounted) { props.onUnmount?.(); } }, }); -
#2803TheToolbarcomponent can now render without needing an explicitstoreprop or aToolbarProvidercomponent wrap.Toolbarnow also supports certain store props such asfocusLoop,orientation,rtl, andvirtualFocus. -
Updated dependencies:
@ariakit/core@0.3.1.
0.3.0
Minor Changes
-
#2714Added support for a dynamicstoreprop on component stores.This is similar to the
storeprop on components, keeping both stores in sync. Now, component store hooks can support modifying the value of thestoreprop after the initial render. For instance:// props.store can change between renders now const checkbox = useCheckboxStore({ store: props.store });When the
storeprop changes, the object returned from the store hook will update as well. Consequently, effects and hooks that rely on the store will re-run.While it's unlikely, this could represent a breaking change if you're depending on the
storeprop in component stores to only acknowledge the first value passed to it. -
#2714BREAKING: TheuseStorefunction exported by@ariakit/react-core/utils/storehas been updated. -
#2760BREAKING: TheuseStoreStatefunction exported by@ariakit/react-core/utils/storehas been updated so it'll always run the selector callback even when the passed store isnullorundefined. -
#2783BREAKING (This should affect very few people): Thecomboboxstate onuseSelectStorehas been replaced by thecomboboxproperty on the store object.Before:
const combobox = useComboboxStore(); const select = useSelectStore({ combobox }); const hasCombobox = select.useState("combobox");After:
const combobox = useComboboxStore(); const select = useSelectStore({ combobox }); const hasCombobox = Boolean(select.combobox);In the example above,
select.comboboxis literally the same as thecomboboxstore. It will be defined if thecomboboxstore is passed touseSelectStore. -
#2783BREAKING (This should affect very few people): Theselectandmenuprops onuseComboboxStorehave been removed. If you need to composeComboboxwithSelectorMenu, use thecomboboxprop onuseSelectStoreoruseMenuStoreinstead. -
#2717Thechildrenprop as a function has been deprecated on all components. Use therenderprop instead. -
#2717Theasprop has been deprecated on all components. Use therenderprop instead. -
#2717ThebackdropPropsprop has been deprecated onDialogand derived components. Use thebackdropprop instead. -
#2745Component stores will now throw an error if they receive another store prop in conjunction with default prop values.
Patch Changes
-
#2737Fixed controlled component stores rendering with a stale state. -
#2758AddedCheckboxProvidercomponent anduseCheckboxContexthook. -
#2759AddedCollectionProvidercomponent anduseCollectionContexthook. -
#2769AddedDisclosureProvidercomponent anduseDisclosureContexthook. -
#2770AddedCompositeProvidercomponent anduseCompositeContexthook. -
#2771AddedDialogProvidercomponent anduseDialogContexthook. -
#2774AddedPopoverProvidercomponent andusePopoverContexthook. -
#2775AddedComboboxProvidercomponent anduseComboboxContexthook. -
#2776AddedSelectProvidercomponent anduseSelectContexthook. -
#2777AddedRadioProvidercomponent anduseRadioContexthook. -
#2778AddedHovercardProvidercomponent anduseHovercardContexthook. -
#2779AddedTabProvidercomponent anduseTabContexthook. -
#2780AddedToolbarProvidercomponent anduseToolbarContexthook. -
#2781AddedTooltipProvidercomponent anduseTooltipContexthook. -
#2782AddedFormProvidercomponent anduseFormContexthook. -
#2783Component store objects now contain properties for the composed stores passed to them as props. For instance,useSelectStore({ combobox })will return acomboboxproperty if thecomboboxprop is specified. -
#2785AddedMenuProvidercomponent anduseMenuContexthook. -
#2785AddedMenuBarProvidercomponent anduseMenuBarContexthook. -
#2785Addedparentandmenubarproperties to the menu store. These properties are automatically set when rendering nested menus or menus within a menubar.Now, it also supports rendering nested menus that aren't nested in the React tree. In this case, you would have to supply the parent menu store manually to the child menu store.
These properties are also included in the returned menu store object, allowing you to verify whether the menu is nested. For instance:
const menu = useMenuStore(props); const isNested = Boolean(menu.parent); -
#2794Thecomboboxprop onuseSelectStoreis now automatically set based on the context. -
#2795Updated theMenucomponent so thecompositeandtypeaheadprops are automatically set tofalsewhen combining it with aComboboxcomponent.This means you'll not need to explicitly pass
composite={false}when building a Menu with Combobox component. -
#2795Thecomboboxprop onuseMenuStoreis now automatically set based on the context. -
#2796Composed store props such asuseSelectStore({ combobox })now acceptnullas a value. -
Updated dependencies:
@ariakit/core@0.3.0.
0.2.17
Patch Changes
-
#2718Fixed import ofuse-sync-external-storepackage for ESM builds. -
Updated dependencies:
@ariakit/core@0.2.9.
0.2.16
Patch Changes
-
Fixed
Collectionnot populating theitemsstate when passingitemsandsetItemstouseCollectionStore. (#2704) -
Fixed
Comboboxcontrolled derived state. (#2705) -
The
Menu'sdisclosureElementstate is now guaranteed to be defined as theMenuButtonelement. Before, it could be overridden by a different element that received focus right before the menu opened, which could cause some weird issues. (#2695) -
Fixed
Tooltipnot closing when it's open while another popover is still visible. (#2692) -
Updated dependencies:
@ariakit/core@0.2.8.
0.2.15
Patch Changes
-
Fixed clicking on a custom dialog backdrop hiding all parent dialogs. (#2688)
-
Fixed
ReactDOM.flushSyncwarning on low-end devices. (#2677) -
Fixed
Tooltipnot hiding when opening a dialog that was previously unmounted. (#2691) -
Fixed
Focusablenot triggeringonFocusVisible(and thus not rendering thedata-focus-visibleattribute) when an element is focused after closing a dialog. (#2691) -
Fixed
Tooltipshowing on mouse move right after it was dismissed (by pressing Esc or opening a popover, for example). (#2691)
0.2.14
Patch Changes
- Fixed
flushSyncwarning. (#2672)
0.2.13
Patch Changes
-
The
asprop has been soft deprecated. Use therenderprop instead. (#2621) -
The
Comboboxcomponent now properly disables theautoSelectbehavior when the user is scrolling through the list of options. This should prevent issues when scrolling virtualized or infinite lists. (#2617) -
Fixed
ComboboxwithautoSelectalways focusing on the first item when a virtualized list is scrolled using arrow keys. (#2636) -
Added experimental element keys to the
Rolecomponent. (#2660) -
The
SelectRenderercomponent doesn't require a store prop or context anymore. (#2619) -
Controlled store updates are now flushed synchronously. This should prevent issues when controlling a
Comboboxby passingvalueandsetValueto the combobox store, for example. (#2671)
0.2.12
Patch Changes
- Fixed
CompositeItemnot being tabbable before hydration. (#2601)
0.2.11
Patch Changes
-
Added
forwardRefandmemoexports to@ariakit/react-core/utils/system. (#2553) -
Added new experimental
CollectionRenderercomponent. (#2553) -
Added new experimental
CompositeRenderercomponent. (#2553) -
Added new experimental
SelectRenderercomponent. (#2553) -
Fixed
ComboboxwithautoSelectandautoComplete="both"so the value is maintained when the combobox input loses focus. (#2595) -
Fixed
ComboboxwithautoSelectprop causing a scroll jump when the popover was opened by typing on the input. (#2599) -
Fixed
Comboboxwith theautoSelectprop not automatically selecting the first option when used in combination withSelectafter the selected option is re-mounted. (#2592) -
Updated composite item components with the
focusOnHoverprop set totrueso that they don't scroll into view when hovered. (#2590) -
Fixed
Menuinitial focus when used in combination withCombobox. (#2582) -
Fixed
Popovernot updating its position when the placement changes while the popover is closed. (#2587) -
Fixed
Selectnot scrolling selected option into view in Safari. (#2591) -
Updated dependencies:
@ariakit/core@0.2.7.
0.2.10
Patch Changes
-
Fixed
defaultItemspassed to the collection store being overriden when new items are added. (#2559) -
Fixed
Comboboxwith theautoSelectprop not allowing the user to scroll when the list of items is virtualized. (#2562) -
Fixed
Compositenot moving focus to items by pressing the arrow keys when the active item isn't rendered. (#2561) -
Fixed
CompositeItemnot being tabbable before hydration. (#2565) -
Updated dependencies:
@ariakit/core@0.2.6.
0.2.9
Patch Changes
-
Added new
disclosureprop to theDisclosurestore. (#2518) -
Fixed
Focusablenot receiving focus when rendered as a native button on Safari. (#2534) -
Fixed
DialogwithpreventBodyScrollset totrue(default) not preventing body scroll on nested animated dialogs. (#2534) -
Updated dependencies:
@ariakit/core@0.2.5.
0.2.8
Patch Changes
-
Added
isValidElementWithReffunction to@ariakit/react-core/utils/misc. (#2486) -
Added
getRefPropertyfunction to@ariakit/react-core/utils/misc. (#2486) -
Added
mergePropsfunction to@ariakit/react-core/utils/misc. (#2486) -
Renamed
useForkReftouseMergeRefs. (#2486) -
The
renderprop now supports aReactElementas a value. See the Composition guide for more information. (#2486)
0.2.7
Patch Changes
- Fixed deeply nested
Dialognot removing theinertattribute from elements outside when closed. (#2507)
0.2.6
Patch Changes
-
Added missing
typesfield to proxy package.json files. (#2489) -
Updated dependencies:
@ariakit/core@0.2.4.
0.2.5
Patch Changes
-
Added
.cjsand.jsextensions to paths in proxy package.json files to support bundlers that can't automaically resolve them. (#2487) -
Updated dependencies:
@ariakit/core@0.2.3.
0.2.4
Patch Changes
-
The
Checkboxcomponent now acceptsstring[]as thevalueprop. This is to conform with the native input prop type. If a string array is passed, it will be stringified, just like in the native input element. (#2456) -
Fixed the
clickOnEnterprop onCheckboxnot working when rendering the component as a native input element. (#2456) -
Fixed typeahead behavior when the composite item element's text content starts with an empty space. (#2475)
-
Removed the delay before focusing on the final focus element when a dialog is closed. (#2462)
-
Fixed
Dialogwrongly focusing on the final focus element when a dialog is closed by clicking on another dialog. (#2462) -
Fixed
Disclosuretiming to set thedisclosureElementstate on the disclosure store. (#2462) -
Removed the
hideOnControlprop fromHovercard. (#2478) -
Fixed clicking outside a
Dialogwhen there's an ancestor element between the dialog content element and the portal element. (#2482) -
Fixed
Popoverwith theupdatePositionprop not moving focus into the popover when it opens. (#2482) -
Updated the
updatePositionprop type onPopoverto allow for returning aPromise. (#2482)
0.2.3
Patch Changes
-
Updated the
SelectPopovercomponent so thecompositeandtypeaheadprops are automatically set tofalsewhen combining it with aComboboxcomponent using thecomboboxprop from the select store. (#2428)This means you'll not need to explicitly pass
composite={false}when building a Select with Combobox component. -
The
ComboboxItemcomponent will now register itself on the combobox store even when the combobox is closed. (#2428) -
Fixed
ComboboxwithvirtualFocusset totrue(default) always reseting the focus when using VoiceOver and Safari to navigate through the items. (#2428) -
Fixed
autoCompleteprop type onComboboxconflicting with the nativeautoCompleteprop. (#2428)It's now possible to extend props from
InputHTMLAttributeswithout having toOmittheautoCompleteprop. -
The
SelectListandSelectPopovercomponents will now automatically render thearia-multiselectableattribute even when thecompositeprop is set tofalse, but only when the underlying element has a composite role. (#2428) -
Fixed
Compositerendering thearia-activedescendantattribute even when thecompositeprop was set tofalse. (#2428) -
Fixed
Focusabletriggering focus visible when pressing the Alt/Option key. (#2428) -
Added
useAttributehook. -
Fixed
activeIdstate onTabnot updating correctly when settingselectedIdwith the Next.js App Router. (#2443) -
Updated dependencies:
@ariakit/core@0.2.2.
0.2.2
Patch Changes
-
Added
alwaysVisibleprop toDisclosureContentand derived components to allow the content to be visible even when theopenstate isfalse. (#2438) -
Fixed
useHovercardStoreanduseTooltipStorenot updating the state when thetimeout,showTimeoutorhideTimeoutprops changed. (#2421) -
Fixed
useTooltipStorenot updating the state when thetypeorskipTimeoutprops changed. (#2421) -
Fixed
Dialogmoving focus on show and hide too early. (#2421) -
Fixed
HovercardandTooltiphiding too early when pressing theEscapekey. (#2421) -
Removed unnecessary
tabIndex={0}prop fromTooltipAnchor. (#2421) -
Updated dependencies:
@ariakit/core@0.2.1.
0.2.1
Patch Changes
- Added a
renderprop to all components as a more flexible alternative tochildrenas a function. (#2411)
0.2.0
Minor Changes
-
BREAKING: Moved props from the
usePopoverStorehook to thePopovercomponent:fixed,gutter,shift,flip,slide,overlap,sameWidth,fitViewport,arrowPadding,overflowPadding,getAnchorRect,renderCallback(renamed toupdatePosition). (#2279)The exception is the
placementprop that should still be passed to the store.Before:
const popover = usePopoverStore({ placement: "bottom", fixed: true, gutter: 8, shift: 8, flip: true, slide: true, overlap: true, sameWidth: true, fitViewport: true, arrowPadding: 8, overflowPadding: 8, getAnchorRect: (anchor) => anchor?.getBoundingClientRect(), renderCallback: (props) => props.defaultRenderCallback(), }); <Popover store={popover} />;After:
const popover = usePopoverStore({ placement: "bottom" }); <Popover store={popover} fixed gutter={8} shift={8} flip slide overlap sameWidth fitViewport arrowPadding={8} overflowPadding={8} getAnchorRect={(anchor) => anchor?.getBoundingClientRect()} updatePosition={(props) => props.updatePosition()} />;This change affects all the hooks and components that use
usePopoverStoreandPopoverunderneath:useComboboxStore,ComboboxPopover,useHovercardStore,Hovercard,useMenuStore,Menu,useSelectStore,SelectPopover,useTooltipStore,Tooltip.With this change, the underlying
@floating-ui/domdependency has been also moved to thePopovercomponent, which means it can be lazy loaded. See the Lazy Popover example. -
BREAKING: The backdrop element on the
Dialogcomponent is now rendered as a sibling rather than as a parent of the dialog. This should make it easier to animate them separately. (#2407)This might be a breaking change if you're relying on their parent/child relationship for styling purposes (for example, to position the dialog in the center of the backdrop). If that's the case, you can apply the following styles to the dialog to achieve the same effect:
.dialog { position: fixed; inset: 1rem; margin: auto; height: fit-content; max-height: calc(100vh - 2 * 1rem); }These styles work even if the dialog is a child of the backdrop, so you can use them regardless of whether you're upgrading to this version or not.
Patch Changes
-
Deprecated the
backdropPropsprop on theDialogcomponent. Use thebackdropprop instead. (#2407) -
The
backdropprop on theDialogcomponent now accepts a JSX element as its value. (#2407) -
The
Dialogcomponent will now wait for being unmounted before restoring the body scroll when thehiddenprop is set tofalse. This should prevent the body scroll from being restored too early when the dialog is being animated out using third-party libraries like Framer Motion. (#2407) -
The
Tooltipcomponent now defaults to usearia-describedbyinstead ofaria-labelledby. (#2279)If you want to use the tooltip as a label for an anchor element, you can use the
typeprop onuseTooltipStore:useTooltipStore({ type: "label" }); -
The
Tooltipcomponent now supports mouse events. (#2279)It's now possible to hover over the tooltip without it disappearing, which makes it compliant with WCAG 1.4.13.
-
Fixed infinite loop on
Portalwith thepreserveTabOrderprop set totruewhen the portalled element is placed right after its original position in the React tree. (#2279) -
Updated dependencies:
@ariakit/core@0.2.0.
0.1.8
Patch Changes
-
Fixed
DialogBackdropnot including thedata-backdropattribute in the initial render, causing a flash of unstyled content when the dialog is initially open. (#2369) -
Fixed
DialogcallinghideOnInteractOutsidetwice when clicking on the backdrop. (#2369) -
The built-in
DialogBackdropcomponent is no longer focusable. (#2369) -
Call
autoFocusOnHideandautoFocusOnShowwith anullargument when there's no element to focus or the element is not focusable. This allows users to specify a fallback element to focus on hide or show. (#2369)
0.1.7
Patch Changes
-
Fixed
Menufocusing on the first menu item rather than the menu container when opened with a mouse click. (#2339) -
Added
getPersistentElementsprop toDialogto better support third-party elements that are already in the DOM by the time the dialog is opened. (#2339) -
Added support on
Dialogfor nested/parallel dialogs, such as portalled dialogs created by third-party libraries and extensions. (#2339) -
Fixed nested
Dialogclosing when dragging from the nested dialog to the parent dialog. (#2339) -
Fixed build target. (#2355)
-
Updated JSDocs.
-
Updated dependencies:
@ariakit/core@0.1.5.
0.1.6
Patch Changes
-
Added
FocusableContainercomponent to control whetherFocusablecomponents inside it can be auto focused when they have theautoFocusprop. (#2322) -
Fixed
Selectcomponent causing a scroll jump when it's dynamically rendered in a portal. (#2322) -
Fixed a bug where passing controlled props to a component store wouldn't always call the state setter with an updated value. (#2328)
-
Fixed
Menunot respectinghidden={false}. (#2328) -
Updated JSDocs.
-
Updated dependencies:
@ariakit/core@0.1.4.
0.1.5
Patch Changes
-
Fixed
FormRadioerror when not explicitly providing the composite store. (#2313) -
Fixed invariant error messages on
Menucomponents. (#2318) -
Updated validate and submit callbacks on
Formso they always run in a consistent order. (#2319) -
Fixed nested
Dialogcomponents when they are conditionally mounted. (#2310) -
Updated dependencies:
@ariakit/core@0.1.3.
0.1.4
Patch Changes
-
Added support for the
inertattribute on theDialogcomponent. If the browser supportsinert, modal dialogs will now use it rather than focus trap regions. (#2301) -
Fixed nested modal
Dialogalso closing the parent dialog when clicking outside. (#2300) -
Fixed modal
Dialogeventually losing focus todocument.body. (#2300) -
Fixed
ComboboxwithautoSelectandautoCompleteset tobothorinlinewhere the completion string would lose its selected state. (#2308) -
Fixed
Comboboxnot processing composition text (like chinese characters or accents). (#2308)
0.1.3
Patch Changes
-
Fixed
Dialognot returning focus when closed when rendered withReact.lazy. (#2290) -
Fixed
Hovercardbeing shown on touch/tap on mobile devices. (#2291) -
Fixed
Hovercardnot properly cleaning up the timeout to hide the card when unmounted. (#2289) -
Updated dependencies:
@ariakit/core@0.1.2.
0.1.2
Patch Changes
-
Added missing
defaultValueprop back touseRadioStore. (#2265) -
Updated dependencies:
@ariakit/core@0.1.1.
0.1.1
Patch Changes
- Removed extra
console.logfromHovercard.
0.1.0
Minor Changes
-
Updated package names to include the
@ariakitscope, providing a more distinct and specific namespace for our packages.Additionally, we've made a change to the versioning system, moving from
v2.0.0-beta.xtov0.x.x. This alteration means that although the library is still in beta, we can release breaking changes in minor versions without disrupting projects that don't set exact versions in theirpackage.json.- npm i ariakit + npm i @ariakit/react
Patch Changes
-
Packages are now ESM by default (commonjs modules are still available with the
.cjsextension). -
Updated dependencies:
@ariakit/core@0.1.0.