Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessibility Enhancements - Aria tags, Space/Enter keys #4466

Closed
ACPK opened this issue Feb 24, 2021 · 2 comments
Closed

Accessibility Enhancements - Aria tags, Space/Enter keys #4466

ACPK opened this issue Feb 24, 2021 · 2 comments

Comments

@ACPK
Copy link

ACPK commented Feb 24, 2021

Related tickets: #1399 and #2456

When visiting https://react-select.com using a screenreader, the dropdown select boxes are opening via the down arrow rather than the enter button.

In Chrome and Safari, the drop-downs are failing our ADA compliance process as "enter" doesn't open a dropdown.

Here is the compliance information: https://www.w3.org/TR/wai-aria-practices/examples/listbox/listbox-collapsible.html

@ACPK ACPK changed the title ADA Bug: Accessibility Enhancements - Aria tags, Space/Enter keys Feb 24, 2021
@ebonow
Copy link
Collaborator

ebonow commented Feb 24, 2021

Greetings @ACPK ,

Two points here to address, one being the issue you are raising as an issue, and the other being the concerns around accessibility.

To begin with, their own examples of comboboxes and typeaheads do not open when clicking enter while focused, so I am uncertain as to what standards compliance you are looking for:
https://www.w3.org/TR/wai-aria-practices/examples/combobox/aria1.1pattern/listbox-combo.html

When looking at the referenced compliance:

The example listbox on this page implements the following keyboard interface. Other variations and options for the keyboard interface are described in the Keyboard Interaction section of the Listbox Design Pattern.

When visiting the Keyboard Interaction section, there is no specified criteria for "Enter" which leads me to believe that the example is a variation but not standard.

If you would like guidance on implementing a select which toggles on enter, we can assist you on implementing a variation that fits your needs.

const [ menuIsOpen, setMenuIsOpen ] = useState(false);
const onKeyDown  = e => e.key === 'Enter' && !menuIsOpen && setMenuIsOpen(true);
const onMenuClose = () => setMenuIsOpen(false);

return <Select menuIsOpen={menuIsOpen} onKeyDown={onKeyDown} onMenuClose={onMenuClose} />

Demo codesandbox

Regarding react-select a11y, it's been decided that the best strategy was to support initiatives via aria-live due to inconsistent support with various features such as multi selection support or identifying selected options that aren't in the input. We plan to add a completely new section to the documentation to better discuss some of these limitations and provide more information specifically for Accessibility along with some other a11y considerations for building more accessible controls.

Furthermore, the next release will be focused heavily on PR #4414 which will bring more customization to the aria-live functionality, however the PR contains some findings about the ongoing status of accessibility specifically around aria-live. Once aria-live has received its due attention, we can investigate in what ways the other attributes and roles intersect and conflict with each other.

Again happy to discuss further but this does not appear to be an issue with compliance and react-select provides the tools to add additional accessibility features.

@ebonow ebonow closed this as completed Feb 24, 2021
@bozdoz
Copy link

bozdoz commented Feb 25, 2021

There is a difference between the links: one is a listbox depicting Aria 1.0, and one is a combobox depicting Aria 1.1. I would guess that Enter should not actually open the combobox, since it would be similar to a native , and Enter does not appear to open a native select dropdown (also, Aria 1.1 combobox does not open with Enter).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants