Commit bf6773d
Port #1084 (part) to dtq-dev-9-base: accessible labels for the suggestion inputs, reject reason and banner
Card X-02a, part C of three. Seven templates the v9 upgrade took wholesale from vanilla 9.3, so the
remaining accessibility hunks of 5a92fdf were never applied.
The five autocomplete inputs (input-suggestions and its dso, validation, person and org-unit
variants) carried a placeholder and nothing else: a placeholder is not a label, so a screen reader
announced them as an unnamed edit field. Each input now gets [id]="name + '-input'" and a
visually-hidden <label> bound to the same expression. The workflow reject-reason textarea had the
same problem and now has id="reason" and a label carrying the reason placeholder key. The dspace
theme's home banner image gets the translated [alt] the fork added.
Fork mistakes ported fixed rather than literally:
1. class="sr-only" does not exist in Bootstrap 5 and 9-base defines it nowhere
(git grep -nE '^[[:space:]]*\.sr-only' -- src => 0 hits, "bootstrap": "^5.3"); a literal port would
render a visible label above every autocomplete. visually-hidden is used, defined at
src/styles/_global-styles.scss:280.
2. <label for="name + '-input'"> is a static attribute, not a binding - it emits those 15 characters
literally and pairs with nothing. It is ported as [attr.for]="name + '-input'", matching the
input's [id] expression, so the association is real.
3. validation-suggestions also carried a static id="name" on the same input as the fork's new [id]
binding. Leaving both would keep a second element answering to id="name" in the submission form,
so the static one is removed and only the per-instance binding remains.
The five suggestion templates keep their existing <button class="sr-only" type="submit">: that is
pre-existing vanilla markup on 9-base (29 files use the class), out of scope here, and touching it
would mix an unrelated Bootstrap-5 migration into an accessibility port.
Tests: 5a92fdf ships none. input-suggestions.component.spec.ts gains cases asserting the label
resolves to the input it names (label.htmlFor === input.id, id non-empty and derived from the name
input) rather than asserting that a string is present in the template. Proven load-bearing with
negative controls - see the PR description.
Source: 5a92fdf (dtq-dev PR #1084), partial - the search boxes from the same commit are in the
sibling PR for card X-02a part B.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 8ac588e commit bf6773d
8 files changed
Lines changed: 47 additions & 2 deletions
File tree
- src
- app
- entity-groups/research-entities/submission/item-list-elements
- org-unit/org-unit-suggestions
- person/person-suggestions
- themes/dspace/app/home-page/home-news
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
58 | 91 | | |
59 | 92 | | |
60 | 93 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
0 commit comments