You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(form-controls): un-nest hidden form input to fix nested-interactive a11y (#2720)
* fix(form-controls): un-nest hidden form input to fix nested-interactive a11y
Checkbox, Switch, Toggle and Radio rendered their VisuallyHiddenInput inside
the interactive control (button[role]), which axe flags as `nested-interactive`
when used in a form; the hidden input also failed the `label` rule.
Render the hidden input as a sibling of the control (multi-root), and mark
VisuallyHidden `fully-hidden` as aria-hidden. To keep consumer `<style scoped>`
working once the component becomes multi-root (Vue only auto-forwards the parent
scope id to single-root components), add `useForwardScopeId()` and forward the
parent scope id onto the control.
- VisuallyHidden: `fully-hidden` now sets aria-hidden="true" (it is tabindex=-1,
so there is no aria-hidden-focus risk); `focusable` is unchanged.
- Radio: default aria-checked to false (role=radio requires aria-checked).
- BEHAVIOUR CHANGE: these four components are now multi-root (fragment) in all
cases, not only inside forms.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* test(Toggle): await trigger in beforeEach hooks
Await the `trigger('click')` calls in the toggling `beforeEach` blocks so
Vue's reactive updates flush before assertions run.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* test(shared): cover useForwardScopeId no-op when parent has no scoped styles
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments