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

Make the *picker_selector* keyboard accessible #35

Open
carlhaman opened this issue Aug 11, 2020 · 2 comments
Open

Make the *picker_selector* keyboard accessible #35

carlhaman opened this issue Aug 11, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@carlhaman
Copy link

You wanted some feedback on accessibillity.

If the picker_selector divs were to have role="button" and tabindex="0" they would be keyboard focusable. Then keydown eventhandlers for arrowkeys could move them.

@Sphinxxxx Sphinxxxx added the enhancement New feature or request label Aug 14, 2020
@Sphinxxxx
Copy link
Owner

Thanks, will keep that in mind! (Pull request welcome)

@masi
Copy link

masi commented Apr 23, 2021

role="button" has nothing to do with being focusable: tabindex="0" is enough.

If you use role="button" you tell assistive technologies that the element acts like a button, ie acts on mouse click, space and enter. Anyway the picker_selector is a slider, not a button.

I suggest to implement this pattern:
https://www.w3.org/TR/wai-aria-practices/#slider

Naturally you don't need to worry much about screen readers, but the keyboard actions are reasonable. If you opt to use role=slider make sure to add all other attributes required by the pattern. If not it is better to use no role at all.

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

No branches or pull requests

3 participants