Repository navigation
fix(core): add accessible label to Input story - #564
ChrisJr404 wants to merge 1 commit into
Conversation
|
|
|
Thanks for the fix, @ChrisJr404! The change looks right. While you're there, the play can find the field by its new name: canvas.getByRole('textbox', { name: 'Sample text input' }) |
|
View your CI Pipeline Execution ↗ for commit 287ba1e
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
|
Hi @ChrisJr404, just checking in! The fix is still good to go, it only needs a rebase onto master to resolve the conflict with #571. If you don't have time for it, no worries: let me know and I'll take it from here, keeping your commit. |
|
Hi @ChrisJr404, one more thing for when you rebase! This PR only touches a story, so the commit should be Could you reword it and force-push? For example: git commit --amend -m "chore(storybook): add accessible label to Input story"
git push --force-with-leasePlease update the PR title to match too. |
|
Hi @ChrisJr404, closing this one since it's been waiting on the rebase for a while. Thanks for the fix anyway! #555 stays open so it can be picked up again. |
Closes #555
Problem
The Input "Simple" story rendered an
<input>with no accessible name, so axe-core'slabelrule flagged a violation in the story accessibility checks.Fix
Added an
aria-labelto the Simple story'sargs, giving the field an accessible name and showing how to label the component. This matches the issue's suggested approach and keeps the example self-contained with no change to component logic.Verification
yarn tsc -p ./tsconfig.json --noEmitpasses (stories are included).yarn vitest run --config=vitest.config.mjs input.storiespasses (story-as-test, Chromium).runOnly: ['label']against a bare input vs. one with thearia-label: the bare input reports thelabelviolation, and the labeled input reports none.