-
Notifications
You must be signed in to change notification settings - Fork 481
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
feat(overlay-dropdown): add arrow key navigation #2679
Conversation
return ( | ||
<li onClick={ onClick }> | ||
<li role="menuitem" onClick={ onClick } onKeyDown={ handleKeydown }> | ||
<button type="button" title={ text }> |
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.
Consider making the button the clickable element (for A11y purposes).
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.
Consider making the key-up-down-to-change selection a DOM-only / no react directive:
This would simplify it and allow us to re-use it in other areas easily.
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.
I actually come from this direction in a first iteration but went away from it.
Simple reason: getting away from React made it harder to test, firing the native events instead of simulating it in our existing Enzyme infrastructure. Adding it via onKeyDown
made it much easier to test.
@andreasgeier I know there are a couple of reviews assigned to you currently, so I don't want to block you with this if it's not necessary. It's up to you whether you want to have a look UI wise. |
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.
✅ Works as expected
Marking this for M52 milestone, since we mention it in the blog post |
144c9cf
to
79a4376
Compare
I rebased this on top of the latest |
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.
Yes, but I probably won't get back to it during spring cleaning. I am happy we have this as a built-in feature for all overlay dropdowns now, and also easily tested. We can reconsider making it an even more generic feature in the future, if we want to. |
This adds arrow key navigation for all overlay dropdowns (e.g. create tab, context action, ...). It mirrors the behavior we already have with tab navigation.
Closes #2626
Build on demand artefacts (Build is running ...)