Skip to content

feat(aria-snapshot): expose aria-invalid in ARIA snapshots#40966

Open
adityasingh2400 wants to merge 1 commit into
microsoft:mainfrom
adityasingh2400:fix-34839
Open

feat(aria-snapshot): expose aria-invalid in ARIA snapshots#40966
adityasingh2400 wants to merge 1 commit into
microsoft:mainfrom
adityasingh2400:fix-34839

Conversation

@adityasingh2400
Copy link
Copy Markdown

Summary

  • Surface aria-invalid in ARIA snapshots so form-validation tests can assert on the invalid state. Adds an invalid boolean prop next to the existing checked / disabled / expanded / level / pressed shape, and emits [invalid] for elements whose role is in the WAI-ARIA 1.2 list (textbox, combobox, checkbox, radiogroup, spinbutton, etc.).
  • aria-invalid="true" | "grammar" | "spelling" all map to the boolean flag for snapshot purposes; the distinct values remain available through the existing getAriaInvalid helper for accessibility consumers.

Fixes #34839

Form-validation tests with ARIA snapshots could not assert on the
invalid state of an input, because `aria-invalid` was not surfaced
in the snapshot at all. Add an `invalid` boolean prop mirroring the
existing `checked` / `disabled` / `expanded` / `level` / `pressed`
shape, and emit `[invalid]` next to the role for elements whose role
appears in the WAI-ARIA 1.2 list of roles that support `aria-invalid`.

Treats `aria-invalid="true" | "grammar" | "spelling"` as `true` for
snapshot purposes; the distinct values are still available through
the existing `getAriaInvalid` helper for accessibility tree consumers.

Fixes: microsoft#34839
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.

[Feature]: Expose aria-invalid in ARIA Snapshots

1 participant