Commit d4b3396
committed
fix: include a visually hidden suffix in repeated labels
The "Describe the specific area" label is repeated for each
conditionally shown input.
Colin R pointed out that this can cause an accessibility problem when
using e.g. Dragon Naturally Speaking to control the browser. If multiple
elements on the same page have the same label, it won't know which you
mean. When javascript is working there should only be one of them
visible on the page, but the fields are still there.
Putting the unique part at the end should mean that the user can say the
label as it appears visually, "Describe the specific area" and Dragon
can prompt which one specifically they mean, e.g. "Describe the specific
area: right breast"
This should also workaround our tests in CI for some reason not running
the javascript that hides the non-selected fields. We may need
to look into this further, but it doesn't block this work.1 parent 40b7e49 commit d4b3396
File tree
5 files changed
+67
-17
lines changed- manage_breast_screening
- mammograms/forms
- nhsuk_forms
- fields
- jinja2/forms
- tests/fields
- tests/system/clinical
5 files changed
+67
-17
lines changedLines changed: 38 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
100 | 104 | | |
101 | 105 | | |
102 | 106 | | |
| |||
105 | 109 | | |
106 | 110 | | |
107 | 111 | | |
| 112 | + | |
108 | 113 | | |
109 | 114 | | |
110 | 115 | | |
| |||
224 | 229 | | |
225 | 230 | | |
226 | 231 | | |
227 | | - | |
228 | | - | |
229 | | - | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
230 | 241 | | |
231 | 242 | | |
232 | 243 | | |
| |||
255 | 266 | | |
256 | 267 | | |
257 | 268 | | |
258 | | - | |
| 269 | + | |
259 | 270 | | |
260 | 271 | | |
261 | | - | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
262 | 276 | | |
263 | | - | |
264 | 277 | | |
265 | 278 | | |
266 | 279 | | |
| |||
292 | 305 | | |
293 | 306 | | |
294 | 307 | | |
295 | | - | |
296 | | - | |
297 | | - | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
298 | 317 | | |
299 | 318 | | |
300 | 319 | | |
| |||
415 | 434 | | |
416 | 435 | | |
417 | 436 | | |
418 | | - | |
419 | | - | |
420 | | - | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
421 | 446 | | |
422 | 447 | | |
423 | 448 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
4 | 9 | | |
5 | 10 | | |
6 | 11 | | |
| 12 | + | |
7 | 13 | | |
8 | 14 | | |
9 | 15 | | |
| |||
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
19 | 24 | | |
20 | 25 | | |
21 | 26 | | |
| |||
73 | 78 | | |
74 | 79 | | |
75 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
76 | 93 | | |
77 | 94 | | |
78 | 95 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
103 | | - | |
104 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| |||
0 commit comments