Repository navigation
fix(storybook): set aria-invalid on the input field - #339
Merged
Merged
Conversation
The Input component styled the invalid state but never told assistive technology about it, so a screen reader announced an invalid field as valid. Bind `aria-invalid` to `invalid || undefined`, as Textarea and Otp already do, so the attribute is left off when the field is valid. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Description
The Storybook Input component styled the invalid state but never set
aria-invalidon its native<input>, so assistive technology announced an invalid field as valid. The Input docs page already tells readers to set it.This binds
:aria-invalid="invalid || undefined", placed like the same binding inTextarea.vueandOtp.vue, so the attribute is left off when the field is valid.Related issue
Follow-up to #338, which added the same binding to Textarea.
Type of change
Checklist
feat(theme): …)pnpm build:nodocs && pnpm lint && pnpm typecheck && pnpm testand everything passespnpm changeset) for changes to publishable packages, or this change only touches docs/storybook/app/playground/testsdist/,.styleframe/)mainand stays focused in scopeNotes / screenshots
Checked in headless Chrome against the built Storybook (
pnpm --filter @styleframe/storybook build):theme-recipes-forms-input--invalid:input.input-fieldhasaria-invalid="true"(it had none before).theme-recipes-forms-input--default: noaria-invalidattribute.Package checks ran instead of the full pre-PR loop:
pnpm build:nodocs,oxlintandoxfmt --checkon the file, the Storybook build, andvue-tsc --noEmit -p tsconfig.app.jsonin Storybook, which reports the same 18 existing errors asmainand none inInput.vue. Storybook has no test script.🤖 Generated with Claude Code