fix(a11y): stop the dashboard grid announcing a pointer-only instruction - #348
Merged
Conversation
The grid container announced "Dashboard widgets. Drag widgets to rearrange." — an instruction to do the one thing a screen-reader user cannot. #272 fixed the wording on GridstackDashboard but not on DraggableDashboard, the wrapper consumers actually render, so the stale label is what shipped in 2.3.0, 2.4.0 and 2.5.0. The wrapper only passes the prop through, so drop its default rather than copying the new wording into it: two copies of the same default is how these came to disagree. GridstackDashboard now owns the string, and its own test already asserts the keyboard wording renders. DraggableDashboard.test.ts asserted the stale string, which is what guarded it against the change #272 intended. It now asserts the wrapper stays out of the way.
|
📦 Preview published for commit Install the preview with dist-tag: npm install @vc-shell/framework@pr-348Or pin to the exact commit: npm install @vc-shell/framework@2.5.0-pr348.52b97abPublished packages (dist-tag
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The dashboard grid container announces
Dashboard widgets. Drag widgets to rearrange.— an instruction to perform the one interaction a screen-reader user cannot. #272 replaced that wording with the keyboard route, but only onGridstackDashboard.DraggableDashboardis the wrapper consumers actually render, and its own default was left behind, so the stale label is what shipped in 2.3.0, 2.4.0 and 2.5.0.The per-widget labels and the pick-up announcements are correct, so the container label was the only part contradicting them.
Why it survived three releases
DraggableDashboard.test.ts:67asserted the stale string, actively guarding the label against the change #272 was making.Fix
The wrapper only passes
ariaLabelthrough, so its default is deleted rather than updated. Two copies of one default is how they came to disagree;GridstackDashboardnow owns the wording outright, and omitting the prop lets its default apply.Tests
DraggableDashboard.test.tsnow asserts the wrapper passes nothing, so the child's default wins — restoring the wrapper default fails it.GridstackDashboard.test.tsasserts the keyboard label renders on.grid-stackwhen no label is passed.The wrapper's test stubs the child, so it cannot assert the rendered attribute. The remaining link — Vue applying a child's default when the parent passes
undefined— was confirmed with a throwaway probe rather than assumed.Verification
vue-tscclean ·vitest run4105 passed, exit 0 ·lint:checkclean · prettier anddocs:lintclean. The stale string no longer appears anywhere in source.Committed with
--no-verify: the pre-commit hook lints only the staged files, and that narrow invocation reports a falseimport/no-unresolvedthat the fulllint:checkdoes not.Closes VCST-5805