Commit a1147b0
committed
a11y(raids): announce the conditional distance input via aria-live (#233)
When the user flips the location-mode radio from "Use areas" to "Set
distance", the distance input appears via an `@if` block. Non-sighted
users wouldn't be notified that a new field is now focusable.
Wrap the `@if` in `<div aria-live="polite" aria-atomic="true">` so
screen readers announce the field's appearance (and read its label)
when the user toggles modes. Added a spec asserting the live region
is present with the right attributes and that the distance input
lands inside it after the mode switch.1 parent a087981 commit a1147b0
2 files changed
Lines changed: 20 additions & 7 deletions
File tree
Lines changed: 9 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
| |||
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
90 | 101 | | |
0 commit comments