Repository navigation
fix(lab): a busy comment editor's Cancel link stays in the tab order - #7909
Conversation
MetadataActionLink passes isDisabled to Link, which keeps a disabled link focusable with aria-disabled and blocks activation (spec:AST-085 FR1, FR2), instead of dropping it from the tab order with tabIndex=-1. Link's disabled paint now applies too (FR6).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report📚 Storybook Preview🧪 Sandbox PreviewNo new or modified components detected. Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Visual Regression46 of 490 shot(s) changed. A change here is a question, not a failure: check whether the after is the
and 26 more. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
There was a problem hiding this comment.
This looks ready to approve: routing the comment editor's Cancel link through Link's own isDisabled keeps it in the Tab order while an edit saves, exposes it as disabled, refuses activation and gives it the disabled paint, as spec:AST-085 FR1, FR2, FR5 and FR6 require. The new test fails on main and passes on this branch, and in the browser Shift+Tab from the edit box now reaches Cancel while Enter leaves the edit open. Nothing further is needed from you.
[Automated review]
Fixes part of #7819 (the comment editor's Cancel link).
User impact
While an edited comment is saving, a keyboard or screen-reader user loses the editor's Cancel link: it is pulled out of the tab order with
tabIndex=-1, so Shift+Tab skips it and they can't find it or hear that it is disabled. After this change Cancel stays in the tab order, reportsaria-disabled="true", refuses activation, and shows the system's disabled paint.Problem and solution fit
MetadataActionLink, the lab helper behind the editor's Cancel and a comment's Edited link, setsaria-disabledandtabIndex={-1}on its Link instead of using Link's own disabled state.isDisabled.Expected behavior and authority
spec:AST-085(current):aria-disabled="true"and keeps its enabled focus order.Smallest restoration
MetadataActionLinkpassesisDisabledto Link instead of settingaria-disabledandtabIndexitself. Link then:aria-disabled;The existing
onClickguard stays as a second line of defense. There is no new prop, and nothing changes while the link is enabled.A new
Lab/Commentsstory, "Saving an edit", keeps an edit's save pending so the busy editor can be inspected.Evidence
tabindex="-1"while busy, and Shift+Tab from the editor's text box never reaches it. The new test fails onmain.Scope
The editor's Post button and the panel's Clear all are core Buttons, so they follow the core Button issue rather than this lab change.
@astryxdesign/labis private, so there is no Changeset.Testing
pnpm exec vitest run packages/lab/src/Comments: 68 passed. The new test fails onmain, where Cancel hastabindex="-1".Commit hook repository checks pass.
Real browser: headless Chrome 156 over CDP, with accessibility nodes from
Accessibility.getPartialAXTree.main's lab source; after uses this head.tabindexaria-disabled-1truetrue