Add aria-labelledby to Console Config settings controls#265207
Add aria-labelledby to Console Config settings controls#265207
Conversation
…g page Add aria-label attributes to all EuiSwitch components and the EuiFieldNumber on the Console settings page so that screen readers announce the setting names along with the control state. Fixes accessibility issue where switches were announced as "On, on, switch" without the corresponding setting name, and the font size field was announced without its label. WCAG 4.1.2: Name, Role, Value (Level A) Agent-Logs-Url: https://github.com/elastic/kibana/sessions/588ad37a-5f2c-46c7-bca2-c43f74d5ac17 Co-authored-by: alexwizp <20072247+alexwizp@users.noreply.github.com>
…-label
Per review feedback: add id to SettingsFormRow labels and use
aria-labelledby on EuiSwitch/EuiFieldNumber to reference the visible
label. Set showLabel={false} and remove label prop on all switches.
Remove unused ON_LABEL/OFF_LABEL constants.
Agent-Logs-Url: https://github.com/elastic/kibana/sessions/15cf4601-88f1-4dde-b0ad-143613bdc7ed
Co-authored-by: alexwizp <20072247+alexwizp@users.noreply.github.com>
Done in
|
|
Pinging @elastic/kibana-accessibility (Project:Accessibility) |
|
/ci |
|
/ci |
⏳ Build in-progress, with failures
Failed CI Steps
Test Failures
Historycc @alexwizp @Copilot |
ElenaStoeva
left a comment
There was a problem hiding this comment.
Thanks for working on this @alexwizp. I tested locally and now the switches are announced correctly. However, these changes also cause changes in the UI: because we removed the labels, they are no longer displayed next to the switches. Is there a reason why they were removed? If not, we should put them back.
Before:
Now:
|
@ElenaStoeva yes, it was done one purpose, normally we don't need to do that |
|
@elastic/eui-team could you please confirm that ^^^^ |
I see, let's also check with @EdLewisEL and @jovana-andjelkovic - do you both have any opinion on the question in #265207 (review)? |
|
/ci |
from an "eui" point of view, i agree with the change and the "on/off" labels being removed usage guidelines about labels suggest they be action-oriented and descriptive — with the change, labels on the left e.g. "Save requests to history" are being properly associated with each switch, making "on/off" unnecessary but let's also wait for @EdLewisEL and @jovana-andjelkovic to confirm |
|
@ElenaStoeva @alexwizp @acstll this is fine, and actually makes it more consistent! Thanks for checking ❤️ |
|
/ci |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Async chunks
History
cc @alexwizp @Copilot |
ElenaStoeva
left a comment
There was a problem hiding this comment.
Thanks all for the feedback! Since there is no objection to the UI change, I'm approving.
Closes: #264630
Switch buttons and the font size field on the Dev Tools Console Config page lack accessible names, causing screen readers to announce them without context (e.g. "On, on, switch" instead of "Save requests to history, switch"). Violates WCAG 4.1.2 Name, Role, Value (Level A).
Changes
idprop toSettingsFormRowand set it on the label element, making it referenceable viaaria-labelledbyEuiSwitchcomponents (history, keyboard shortcuts, a11y overlay, wrap lines, triple quotes, and 4 autocomplete toggles): setaria-labelledbyreferencing the row label,showLabel={false}, andlabel=""EuiFieldNumber(font size): setaria-labelledbyreferencing the row labelON_LABEL/OFF_LABELi18n constantsScreen readers now announce the setting name from the visible row label via
aria-labelledby, rather than relying on a separate hiddenaria-labelor the "On"/"Off" toggle text.