Skip to content

fix(ui): expose Input error state to assistive technology - #46

Merged
royalpinto007 merged 1 commit into
AgentPostmortem:mainfrom
thariq122:feature/fix
Aug 6, 2026
Merged

fix(ui): expose Input error state to assistive technology#46
royalpinto007 merged 1 commit into
AgentPostmortem:mainfrom
thariq122:feature/fix

Conversation

@thariq122

@thariq122 thariq122 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

What & why

This PR improves the accessibility of the Input component by exposing validation errors to assistive technologies.

Closes #35

Changes

  • Added stable IDs using useId()
  • Linked the input to its error message using aria-describedby
  • Added aria-invalid when validation errors exist
  • Added role="alert" to the error message
  • Preserved the existing forwardRef API

Checklist

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

Welcome, @thariq122, and thanks for your first pull request to agent-postmortem.

A quick look at CONTRIBUTING.md covers how things are set up and run here.

I'll review this shortly. Ask anything in the thread if something is unclear.

@royalpinto007

Copy link
Copy Markdown
Contributor

Excellent work @thariq122, this is exactly right.

You went past the issue: useId with a caller override, aria-invalid only when there is an error, aria-describedby that merges an existing one instead of clobbering it, role="alert" on the message, and aria-hidden on the decorative prefix and suffix. That last one matters, screen readers were announcing those as content.

All checks green. Merging. A star is appreciated if this was fun, and there are more open issues whenever you want another.

@royalpinto007
royalpinto007 merged commit e6551b1 into AgentPostmortem:main Aug 6, 2026
7 checks passed
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

This is in, @thariq122. Really appreciate it.

Good, focused change. Exactly the kind of thing agent-postmortem needs.

If agent-postmortem is useful to you, a star goes a long way.

Happy to see more from you whenever you have the time.

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.

Input component renders an error message that is never linked to the field

2 participants