-
Notifications
You must be signed in to change notification settings - Fork 606
Keyboard accessibility improvements to Input component's dropdown area. #10554
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
Keyboard accessibility improvements to Input component's dropdown area. #10554
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currently, react-common has no dependency on blockly and i'd like to keep it that way. react-common is shared between several of makecode's various webapps many of which have nothing to do with blockly at all.
is there a way we can make this a little more generic? could we create a wrapper component in webapp/
that handles the blockly side of things maybe?
910b96d
to
f993f1b
Compare
Hi @riknoll, thanks for your feedback, I appreciate the benefits of good separation of concerns. I've made an attempt to implement a wrapper component as you suggested, have a look at the latest commit and see what you think. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! just remove the import
Co-authored-by: Richard Knoll <riknoll@users.noreply.github.com>
…l key handlers for keyboard accessibility reasons.
09f54e3
to
2c02896
Compare
@glastonbridge looks like a linting issue! you can run |
Demo build: https://dropdown-key-input-capture.review-pxt.pages.dev/
This PR attempts to make keyboard accessibility closer to the WAI-ARIA standard for combo boxes when an input provides a dropdown. Specifically:
How to test
Implementation concerns
Some of the accessible keys for a dropdown are intercepted by Blockly at a high level, specifically escape and enter, and these make accessible navigation problematic. I have implemented a lifecycle operation, to be enabled only for the lifetime of the visible dropdown, which blocks those keyboard shortcuts then reasserts them on close.
This is the best solution that I could find using the information I had, but it is unsatisfyingly complex and I welcome better ways to achieve this.
Whatever approach we use here will need to be extended to the Dropdown component too.