@ariakit/react 0.3.10 → 0.3.12

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 +61 -0
  2. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,66 @@
1
1
  # @ariakit/react
2
2
 
3
+ ## 0.3.12
4
+
5
+ - The auto-select feature on [Combobox](https://ariakit.org/components/combobox) now resets with each keystroke.
6
+ - Fixed [`Combobox`](https://ariakit.org/reference/combobox) with the [`autoSelect`](https://ariakit.org/reference/combobox#autoselect) prop calling `onFocus` with every input change.
7
+ - Fixed [`Hovercard`](https://ariakit.org/reference/hovercard) flickering when used with shadow DOM.
8
+ - Fixed [`Select`](https://ariakit.org/reference/select) with [`Combobox`](https://ariakit.org/reference/combobox) scroll jumping when opening using keyboard navigation.
9
+ - Fixed [`CompositeItem`](https://ariakit.org/reference/composite-item) triggering blur on focus.
10
+ - Fixed [`ComboboxItem`](https://ariakit.org/reference/combobox-item) not triggering the `onClick` event when the item is partially visible.
11
+ - Improved JSDocs.
12
+ - Updated dependencies: `@ariakit/react-core@0.3.12`
13
+
14
+ ## 0.3.11
15
+
16
+ ### Modal Combobox
17
+
18
+ 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).
19
+
20
+ 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.
21
+
22
+ ### Controlling the auto-select functionality of Combobox
23
+
24
+ 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`.
25
+
26
+ 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):
27
+
28
+ ```jsx
29
+ <Combobox
30
+ autoSelect
31
+ getAutoSelectId={(items) => {
32
+ // Auto select the first enabled item with a value
33
+ const item = items.find((item) => {
34
+ if (item.disabled) return false;
35
+ if (!item.value) return false;
36
+ return true;
37
+ });
38
+ return item?.id;
39
+ }}
40
+ />
41
+ ```
42
+
43
+ ### Styling Combobox without an active descendant
44
+
45
+ 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.
46
+
47
+ 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.
48
+
49
+ ```css
50
+ .combobox[data-active-item] {
51
+ outline-width: 2px;
52
+ }
53
+ ```
54
+
55
+ ### Other updates
56
+
57
+ - Fixed [`useTabStore`](https://ariakit.org/reference/use-tab-store) return value not updating its own reference.
58
+ - Fixed keyboard navigation on [Combobox](https://ariakit.org/components/combobox) when the content element is a grid.
59
+ - Fixed [`ComboboxDisclosure`](https://ariakit.org/reference/combobox-disclosure) to update its `aria-expanded` attribute when the combobox expands.
60
+ - Fixed `Maximum update depth exceeded` warning when rendering multiple collection items on the page.
61
+ - Improved JSDocs.
62
+ - Updated dependencies: `@ariakit/react-core@0.3.11`
63
+
3
64
  ## 0.3.10
4
65
 
5
66
  ### Overwriting `aria-selected` value on `ComboboxItem`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ariakit/react",
3
- "version": "0.3.10",
3
+ "version": "0.3.12",
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.10"
40
+ "@ariakit/react-core": "0.3.12"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "react": "^17.0.0 || ^18.0.0",