Skip to content

fix(storybook): set aria-invalid on the input field - #339

Merged
alexgrozav merged 1 commit into
mainfrom
aria-invalid-input-uxf-383
Oct 19, 2026
Merged

alexgrozav merged 1 commit into
mainfrom
aria-invalid-input-uxf-383

Conversation

@alexgrozav

Copy link
Copy Markdown
Contributor

Description

The Storybook Input component styled the invalid state but never set aria-invalid on 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 in Textarea.vue and Otp.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

  • 🐞 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that changes existing behavior)
  • 📖 Documentation
  • ♻️ Refactor / internal (no functional change)
  • 🔧 Build / tooling / CI

Checklist

  • My commits follow Conventional Commits with a package scope (e.g. feat(theme): …)
  • I ran pnpm build:nodocs && pnpm lint && pnpm typecheck && pnpm test and everything passes
  • I added a changeset (pnpm changeset) for changes to publishable packages, or this change only touches docs/storybook/app/playground/tests
  • I added or updated tests where relevant
  • I updated documentation where relevant
  • I did not edit generated files (dist/, .styleframe/)
  • My PR targets main and stays focused in scope

Notes / screenshots

Checked in headless Chrome against the built Storybook (pnpm --filter @styleframe/storybook build):

  • theme-recipes-forms-input--invalid: input.input-field has aria-invalid="true" (it had none before).
  • theme-recipes-forms-input--default: no aria-invalid attribute.

Package checks ran instead of the full pre-PR loop: pnpm build:nodocs, oxlint and oxfmt --check on the file, the Storybook build, and vue-tsc --noEmit -p tsconfig.app.json in Storybook, which reports the same 18 existing errors as main and none in Input.vue. Storybook has no test script.

🤖 Generated with Claude Code

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>
@vercel

vercel Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
styleframe-dev Ready Ready Preview Oct 19, 2026 7:29am UTC
styleframe-dev-storybook Ready Ready Preview Oct 19, 2026 7:29am UTC

Request Review

@alexgrozav
alexgrozav marked this pull request as ready for review October 19, 2026 07:52
@alexgrozav
alexgrozav merged commit 26a2b9d into main Oct 19, 2026
14 checks passed
@alexgrozav
alexgrozav deleted the aria-invalid-input-uxf-383 branch October 19, 2026 07:52

This branch was successfully deployed

2 active deployments
Preview – styleframe-dev — a1c0abb2 Deployed Oct 19, 2026 by vercel[bot]
Preview – styleframe-dev-storybook — a1c0abb2 Deployed Oct 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant