Skip to content

fix(core): add accessible label to Input story - #564

Closed
ChrisJr404 wants to merge 1 commit into
React95:masterfrom
ChrisJr404:fix/input-story-accessible-label
Closed

ChrisJr404 wants to merge 1 commit into
React95:masterfrom
ChrisJr404:fix/input-story-accessible-label

Conversation

@ChrisJr404

Copy link
Copy Markdown

Closes #555

Problem

The Input "Simple" story rendered an <input> with no accessible name, so axe-core's label rule flagged a violation in the story accessibility checks.

Fix

Added an aria-label to the Simple story's args, 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 --noEmit passes (stories are included).
  • yarn vitest run --config=vitest.config.mjs input.stories passes (story-as-test, Chromium).
  • Ran axe-core with runOnly: ['label'] against a bare input vs. one with the aria-label: the bare input reports the label violation, and the labeled input reports none.

@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@ggdaltoso

ggdaltoso commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Thanks for the fix, @ChrisJr404!

The change looks right.
Since then, #571 added a play function to this story, so the branch now conflicts with master.
Could you rebase it?

While you're there, the play can find the field by its new name:

canvas.getByRole('textbox', { name: 'Sample text input' })

@nx-cloud

nx-cloud Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 287ba1e

Command Status Duration Result
nx affected -t lint,test,build,test-storybook,b... ✅ Succeeded 1m 4s View ↗
nx-cloud record -- yarn nx format:check ✅ Succeeded 1s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-10-08 18:41:37 UTC

@ggdaltoso

Copy link
Copy Markdown
Member

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.

@ggdaltoso

Copy link
Copy Markdown
Member

Hi @ChrisJr404, one more thing for when you rebase!

This PR only touches a story, so the commit should be chore(storybook): … instead of fix(core): …. Our release reads conventional commits, and any fix under packages/core publishes a new @react95/core version, even when the library code doesn't change.

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-lease

Please update the PR title to match too.

@ggdaltoso

Copy link
Copy Markdown
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Input: field without a label in the story

2 participants