@ariakit/react 0.3.9 → 0.3.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,73 @@
1
1
  # @ariakit/react
2
2
 
3
+ ## 0.3.11
4
+
5
+ ### Modal Combobox
6
+
7
+ The [Combobox](https://ariakit.org/component/combobox) components now support the [`modal`](https://ariakit.org/reference/combobox-popover#modal) prop on [`ComboboxPopover`](https://ariakit.org/reference/combobox-popover).
8
+
9
+ When a modal combobox is expanded, users can interact with and tab through all the combobox controls, including [`Combobox`](https://ariakit.org/reference/combobox), [`ComboboxDisclosure`](https://ariakit.org/reference/combobox-disclosure), and [`ComboboxCancel`](https://ariakit.org/reference/combobox-cancel), even if they're rendered outside the popover. The rest of the page will be inert.
10
+
11
+ ### Controlling the auto-select functionality of Combobox
12
+
13
+ The [`Combobox`](https://ariakit.org/reference/combobox) component now includes a new [`getAutoSelectId`](https://ariakit.org/reference/combobox#getautoselectid) prop. This allows you to specify the [`ComboboxItem`](https://ariakit.org/reference/combobox-item) that should be auto-selected if the [`autoSelect`](https://ariakit.org/reference/combobox#autoselect) prop is `true`.
14
+
15
+ By default, the first _enabled_ item is auto-selected. Now you can customize this behavior by returning the id of another item from [`getAutoSelectId`](https://ariakit.org/reference/combobox#getautoselectid):
16
+
17
+ ```jsx
18
+ <Combobox
19
+ autoSelect
20
+ getAutoSelectId={(items) => {
21
+ // Auto select the first enabled item with a value
22
+ const item = items.find((item) => {
23
+ if (item.disabled) return false;
24
+ if (!item.value) return false;
25
+ return true;
26
+ });
27
+ return item?.id;
28
+ }}
29
+ />
30
+ ```
31
+
32
+ ### Styling Combobox without an active descendant
33
+
34
+ The [`Combobox`](https://ariakit.org/reference/combobox) component now includes a [`data-active-item`](https://ariakit.org/guide/styling#data-active-item) attribute when it's the only active item in the composite widget. In other words, when no [`ComboboxItem`](https://ariakit.org/reference/combobox-item) is active and the focus is solely on the combobox input.
35
+
36
+ You can use this as a CSS selector to style the combobox differently, providing additional affordance to users who pressed <kbd>↑</kbd> on the first item or <kbd>↓</kbd> on the last item. This action would place both virtual and actual DOM focus on the combobox input.
37
+
38
+ ```css
39
+ .combobox[data-active-item] {
40
+ outline-width: 2px;
41
+ }
42
+ ```
43
+
44
+ ### Other updates
45
+
46
+ - Fixed [`useTabStore`](https://ariakit.org/reference/use-tab-store) return value not updating its own reference.
47
+ - Fixed keyboard navigation on [Combobox](https://ariakit.org/components/combobox) when the content element is a grid.
48
+ - Fixed [`ComboboxDisclosure`](https://ariakit.org/reference/combobox-disclosure) to update its `aria-expanded` attribute when the combobox expands.
49
+ - Fixed `Maximum update depth exceeded` warning when rendering multiple collection items on the page.
50
+ - Improved JSDocs.
51
+ - Updated dependencies: `@ariakit/react-core@0.3.11`
52
+
53
+ ## 0.3.10
54
+
55
+ ### Overwriting `aria-selected` value on `ComboboxItem`
56
+
57
+ It's now possible to pass a custom `aria-selected` value to the [`ComboboxItem`](https://ariakit.org/reference/combobox-item) component, overwriting the internal behavior.
58
+
59
+ ### Limiting `slide` on popovers
60
+
61
+ When components like [Popover](https://ariakit.org/components/popover) and [Menu](https://ariakit.org/components/menu) with the [`slide`](https://ariakit.org/reference/popover#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.
62
+
63
+ ### Other updates
64
+
65
+ - Fixed [`blurOnHoverEnd`](https://ariakit.org/reference/menu-item#bluronhoverend) set to `false` not keeping submenus open.
66
+ - Fixed scroll jump on Safari when selecting a [`CompositeItem`](https://ariakit.org/reference/composite-item).
67
+ - Fixed [`preserveTabOrderAnchor`](https://ariakit.org/reference/menu#preservetaborderanchor) on nested menus.
68
+ - Fixed focus behavior when using the [`preserveTabOrder`](https://ariakit.org/reference/portal#preservetaborder) prop.
69
+ - Updated dependencies: `@ariakit/react-core@0.3.10`
70
+
3
71
  ## 0.3.9
4
72
 
5
73
  ### Automatic role on ComboboxGroup
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ariakit/react",
3
- "version": "0.3.9",
3
+ "version": "0.3.11",
4
4
  "description": "Toolkit for building accessible web apps with React",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",
@@ -37,7 +37,7 @@
37
37
  "components"
38
38
  ],
39
39
  "dependencies": {
40
- "@ariakit/react-core": "0.3.9"
40
+ "@ariakit/react-core": "0.3.11"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "react": "^17.0.0 || ^18.0.0",