Repository navigation
Conversation
🤖 PR meta 🤖🎉 PropsUnlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @theritiktiwari. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. 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. Updated as activity occurs, without notifying anyone named here. Add the |
a37807a to
55ed154
Compare
The CHANGELOG check requires the Unreleased entry to cite the PR that carries it. The fix now lands through WordPress#84869, which supersedes WordPress#82511.
c43ad3c to
60c636a
Compare
The CHANGELOG check requires the Unreleased entry to cite the PR that carries it. The fix now lands through WordPress#84869, which supersedes WordPress#82511.
There was a problem hiding this comment.
Thanks, @adamwoodnz and @chriskmnds. From my pov, the fix is correct and as small as it gets.
I ran sortable-semantics.browser.test.tsx locally against the trunk sources: 4 of the 8 cases fail, read mode and pinned on both surfaces. With the change, all 8 pass.
On the question in #84452 #84528, there was no reason to keep the attributes when dragging is off.
The spread predates the draggable flag, and the aria-disabled="true" assertion that #81967 added only recorded what dnd-kit emits.
Nothing in the packages depends on the disabled activator.
Two things before merging. Grid 0.10.0 went out today, so after the merge the Bug Fixes entry lands under ## 0.10.0.
It needs a rebase and the entry moved to Unreleased.
Also, maybe we can add a story that shows the fix? A tile with a link, a button, and a select in read mode, and a pinned item (draggable: false) in EditMode.
None of the current stories have either, and the a11y addon catches a regression through nested-interactive with them.
Nit: the Accessibility section of the README says "Tab to focus a tile". That now holds only for draggable tiles in edit mode.
Out of scope, as you noted: draggable tiles in edit mode still wrap their content in the role="button" activator (#81596).
The widget dashboard mutes the body, header, and footer with inert in edit mode, so no live control ends up nested there, but a bare grid consumer still hits it.
The fix is to move the handle in the chrome to carry attributes and the keyboard listener, leaving the pointer listener on the tile. That deserves its own issue.
Once this lands, we can close #82511.
Trunk's Vitest conventions check rejects jsdom tests that stub observer APIs, so the `ResizeObserver` stub made Static Checks fail after the rebase. In Browser Mode the test also uses real keyboard events and focus in place of `fireEvent` and fake timers.
The CHANGELOG check requires the Unreleased entry to cite the PR that carries it. The fix now lands through WordPress#84869, which supersedes WordPress#82511.
Grid 0.10.0 was released while this PR was open. The rebase applied the entry cleanly inside the released 0.10.0 section, which would have listed the fix under a version that does not include it.
Tiles are no longer focusable in read mode or when pinned, so the keyboard steps apply only to draggable tiles in edit mode.
No story had native controls inside a tile or a pinned item, so the a11y addon could not catch a regression of the drag wrapper around them. The new stories open in read mode, where the addon runs, and the EditMode stories now pin one tile.
60c636a to
7c183d2
Compare
|
Should we add |
|
Thanks for the review, @retrofox. I pushed these changes:
I agree that #81596 needs its own issue. I updated the description with the new testing steps. |
|
Yes, thanks. It's the same bug as #82507, so this closes both. I added it to the description. |
The stories open in read mode, where no tile is draggable, so the "Draggable" labels misled readers. The descriptions now say that the a11y addon is what checks the stories, and that the pinned tile only matters in edit mode.
|
Please merge at your leisure @retrofox if you're happy with it. I don't have permissions. |
|
Thanks, Adam. |
What?
Closes #82507, closes #84528. Supersedes #82511, which is @chriskmnds' work rebased on trunk. Maintainer edits on #82511 need write access, so I could not push the rebase to the original branch.
Remove inactive drag-control semantics from tile content in
DashboardGridandDashboardLanes, including pinned items.Why?
In read mode, and for pinned tiles in edit mode, tile content is wrapped in a focusable
role="button"witharia-disabled="true". Screen reader users hear enabled links, buttons and form controls inside a disabled button, and keyboard users meet an extra tab stop that does nothing.How?
Apply the sortable attributes only when dragging is enabled. Keep the listeners, refs, the enabled activator and the resize and action controls as they are.
Changes on top of #82511:
item-interactions.jsdom.test.tsxfiles withitem-interactions.browser.test.tsx. Theexpect( activator ).toBeNull()change moved into the new files.sortable-semantics.jsdom.test.tsxfailednpm run test:unit:conventionsbecause it stubsResizeObserver. It is nowsortable-semantics.browser.test.tsx, with the same 8 cases and realuserEventkeys.InteractiveContentstories for both layouts: tiles with a link, a button and a select, and one pinned tile. They open in read mode, so the a11y addon checks them. TheEditModestories now pin their first tile.CHANGELOG.mdentry is under Unreleased, after the Grid 0.10.0 release.Testing Instructions
Checks run with Node 24.18.0:
npm run test:unit:vitest -- packages/grid packages/widget-dashboard: 35 files, 299 tests pass.npm run typecheck -- packages/gridpasses.npm run lint:changelogs -- --require-pr=84869 packages/grid/CHANGELOG.mdpasses.Manual checks in Storybook, for
Widgets/Grid/DashboardGridandWidgets/Grid/DashboardLanes:Interactive Content. Confirm that no tile has anaria-roledescription="sortable"wrapper, and that no control has an ancestor witharia-disabled="true",role="button"ortabindex. The Accessibility panel shows no violations.editMode. The pinned tile's controls still have no such ancestor, and its resize handle remains. The draggable tiles wrap their content in the activator, which is Storybook: Resolve accessibility issues flagged in Storybook #81596 and out of scope.Edit Mode. The first tile is pinned and cannot be dragged.Testing Instructions for Keyboard
Interactive Content, Tab through the tiles. Focus goes from Details to Refresh to Metric in each tile and never stops on a tile wrapper.editMode. In the pinned tile, Tab reaches Details, Refresh and Metric, and then the resize handle.I ran all of the steps above in Chrome on both layouts. With the fix reverted, the Accessibility panel reports a serious
nested-interactiveviolation on all 3 tiles of eachInteractive Contentstory, so the stories catch a regression. No screen reader testing.Screenshots or screencast
No visual change to the components. This changes accessibility semantics only.
Use of AI Tools
The original change was written by @chriskmnds with OpenAI Codex. I used Claude Code to rebase it, move the tests to Browser Mode, add the stories and run the checks. I reviewed the changes.
🤖 Generated with Claude Code