Repository navigation
Commit 4e376da
fix(web): switches announce their real state to screen readers
The shared Switch passed aria-checked={undefined} for every non-mixed
toggle. Base UI's mergeProps copies every key it is given, including
undefined ones, so that overwrote its own aria-checked and the attribute
never reached the DOM. A role="switch" without aria-checked reads as
"off" no matter what, so every toggle in web and desktop was announced
as off and never updated after toggling.
Only pass aria-checked when the switch is mixed so Base UI's real value
survives, and add a test that fails without the fix.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>1 parent a493946 commit 4e376da
2 files changed
Lines changed: 24 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
| |||
0 commit comments