-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update @ariakit/react to 0.4.13 #65907
base: trunk
Are you sure you want to change the base?
Conversation
Size Change: +546 B (+0.03%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
7b4345a
to
c462f05
Compare
c462f05
to
358b229
Compare
358b229
to
9564d6f
Compare
After investigating the unit test failures, it seems like it could be a regression coming from ariakit. I've opened ariakit/ariakit#4180 to confirm whether that's the case. |
62aa1f8
to
cf400cb
Compare
That was indeed an ariakit regression that we caught on our end. A new version with the fix ( There are still some Otherwise, folks can already start to review the code changes and smoke test affected components |
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
That's an interesting case to look into. Somehow the change to make composite items tabbable on invalid gutenberg/test/e2e/specs/editor/various/navigable-toolbar.spec.js Lines 197 to 203 in 5c51436
It appears that I think this highlights a broader issue with Adding something like gutenberg/packages/block-editor/src/components/block-controls/slot.js Lines 21 to 32 in e89e988
|
@diegohaz it sounds like the correct fix would be to somehow trigger a re-render when the toolbar is moved from inline to fixed (and vice-versa)? |
I'm curious why it did't manifest before, while now it fails consistently. What might have changed in the latest couple of ariakit versions? |
Here's my theory: Ariakit now makes composite items (including toolbar items) tabbable when the Those block controls apparently were already receiving a stale store, but since they weren't tabbable before, pressing Shift+Tab would move focus to the first item in the toolbar (which is not in a Slot/Fill). Somehow, this triggered a rerender on I didn't test this thoroughly, but it's not making sense to me that BlockControlsSlot doesn't automatically rerenders when the store changes despite having |
ariakit/ariakit#4202 may help with this specific failing test in the next version of Ariakit, but I believe there's still an underlying issue with slots or elements inside fills not receiving the correct context value, so this might just be sweeping the problem under the rug. This is especially concerning to me:
|
cf400cb
to
b61a2d3
Compare
b61a2d3
to
0d43fd4
Compare
@@ -28,7 +28,7 @@ | |||
"types": "build-types", | |||
"sideEffects": false, | |||
"dependencies": { | |||
"@ariakit/react": "^0.4.10", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For DataViews, I tested that list view's keyboard interactions still work as expected. Then, I also did some smoke testing of other places where I've seen it in use (modals, filters) and have nothing to report.
I pushed a fix for the The I'll file this fix also as a separate PR. |
What?
@ariakit/react
from0.4.10
to0.4.13
@ariakit/test
from0.4.2
to0.4.5
DropdownMenu
andComposite
that are now provided directly byariakit
Why?
How?
package.json
files, remove all references to the target dependenciesnpm cache clean --force && npm run distclean && npm install
to update thepackage-lock.json
filepackage.json
files, re-adding the target dependencies with the latest versionsnpm cache clean --force && npm run distclean && npm install
to update thepackage-lock.json
fileTesting Instructions
Composite
,Tabs
,TabPanel
,DropdownMenuV2
,CustomSelectControl
,Toolbar
,Disclosure
,Divider
,RadioGroup
,ToggleGroupControl
,Tooltip
Looking at the release notes, here are the changes that could affect us:
data-focus-visible
attribute applied synchronously — which should fix a couple of bugs that we noticed in the past (DropdownMenuV2: fix active and focus-visible item glitches #64942, Tabs: unify vertical tabs styles #65387 (comment)). I removed the custom workaround on our side.Composite
-based components have their elements tabbable if the id of the active composite item doesn't correspond to an element in the DOM. I removed the custom workaround added in Composite: make items tabbable if active element gets removed #65720Full changelog
`@ariakit/react` release notes
@ariakit/react@0.4.13
Accessible composite widgets with invalid
activeId
We've improved the logic for composite widgets such as Tabs and Toolbar when the
activeId
state points to an element that is disabled or missing from the DOM. This can happen if an item is dynamically removed, disabled, or lazily rendered, potentially making the composite widget inaccessible to keyboard users.Now, when the
activeId
state is invalid, all composite items will remain tabbable, enabling users to Tab into the composite widget. Once a composite item receives focus or the element referenced by theactiveId
state becomes available, the roving tabindex behavior is restored.Other updates
focusShift
.onChange
from triggering on radios that are already checked.DisclosureContent
setting an incorrectanimating
state value during enter animations.@ariakit/react-core@0.4.13
@ariakit/react@0.4.12
Tab panels with scroll restoration
Ariakit now supports scroll restoration for the
TabPanel
component. This allows you to control whether and how the scroll position is restored when switching tabs.To enable scroll restoration, use the new
scrollRestoration
prop:By default, the scroll position is restored when switching tabs. You can set it to
"reset"
to return the scroll position to the top of the tab panel when changing tabs. Use thescrollElement
prop to specify a different scrollable element:Full height dialogs and on-screen virtual keyboards
A new
--dialog-viewport-height
CSS variable has been added to the Dialog component. This variable exposes the height of the visual viewport, considering the space taken by virtual keyboards on mobile devices. Use this CSS variable when you have input fields in your dialog to ensure it always fits within the visual viewport:Overriding composite state for specific methods
The
next
,previous
,up
, anddown
methods of the composite store now accept an object as the first argument to override the composite state for that specific method. For example, you can pass a differentactiveId
value to thenext
method so it returns the next item based on that value rather than the current active item in the composite store:It's important to note that the composite state is not modified when using this feature. The state passed to these methods is used solely for that specific method call.
Other updates
Tab
to pass therowId
prop when used with other composite widgets.@ariakit/react-core@0.4.12
@ariakit/react@0.4.11
Tabs inside animated Combobox or Select
When rendering Tab inside Combobox or Select, it now waits for the closing animation to finish before restoring the tab with the selected item. This should prevent an inconsistent UI where the tab is restored immediately while the content is still animating out. See Select with Combobox and Tabs.
Other updates
activeId
upon closing the popover.data-focus-visible
attribute.MenuButton
hiding the menu on Safari.@ariakit/react-core@0.4.11
`@ariakit/test` release notes
@ariakit/test@0.4.5
@ariakit/core@0.4.12
@ariakit/test@0.4.4
pointerType
value ofmouse
.@ariakit/core@0.4.11
@ariakit/test@0.4.3
@ariakit/core@0.4.10