Commit 6ac9aea
committed
fix: name the pane pin button and expose whether it is pinned
The button that pins the discussion list carries only an icon, and unlike
the back and drawer buttons either side of it, nothing that names it. A
screen reader reaches it and can say no more than "button". Core already
notices: Button warns in the console when it finds no content and no
accessible label, and this button has been tripping that warning rather
than being read as an omission.
It is also a toggle, and its state was carried entirely by the icon
rotating forty-five degrees when unpinned. Nothing about being pinned was
exposed to assistive technology at all.
The label names the control rather than the action, so it holds still while
the state changes underneath it; `aria-pressed` reports whether it is
currently on. Naming it for the action instead would mean a screen reader
reading a button whose name changes under it, with the state never stated.
`aria-pressed` is given as a string rather than a boolean on purpose.
Mithril renders a boolean as an HTML boolean attribute, so `false` omits
the attribute entirely and `true` renders it empty. Neither is valid ARIA,
and an absent `aria-pressed` reads as a plain button rather than as a toggle
that happens to be off. Core has no other use of the attribute, so there
was no local precedent to follow here.1 parent e792ca2 commit 6ac9aea
2 files changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
73 | 84 | | |
74 | 85 | | |
75 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
953 | 953 | | |
954 | 954 | | |
955 | 955 | | |
| 956 | + | |
956 | 957 | | |
957 | 958 | | |
958 | 959 | | |
| |||
0 commit comments