eui icon indicating copy to clipboard operation
eui copied to clipboard

[All Form Controls][SCREEN READER]: `prepend` and `append` labels are not announced when main control receives focus

Open 1Copenut opened this issue 2 years ago • 0 comments

:warning: Quick note: this issue was originally just for EuiSuperSelect, but then we realized it applied to all form controls with prepend/append.

Description

EuiSuperSelect allows users to add a prepend and/or append prop to render a <label/> or custom React element next to the default listbox button. This label does not create an association with the button or the hidden input for screen readers. Additionally, the input[type="hidden"] is ignored by screen readers. Users do not get the benefit of that appended or prepended label as our component exists today.

Proposed change

I'm proposing we adjust the <button> element inside super_select_control.tsx to include a discretionary aria-labelledby attribute. By moving the id attribute to the button itself, and adding an ID to prepended or appended elements, we can build a combined accessible label.

WCAG success criteria

Screenshots

eui-super-select-prepend

1Copenut avatar Feb 24 '23 18:02 1Copenut