-
Notifications
You must be signed in to change notification settings - Fork 205
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
fix(menu): allow keyboard events to propagate from opened menu #4793
base: main
Are you sure you want to change the base?
Conversation
Lighthouse scores
What is this?Lighthouse scores comparing the documentation site built from the PR ("Branch") to that of the production documentation site ("Latest") and the build currently on Transfer Size
Request Count
|
Pull Request Test Coverage Report for Build 11680202255Details
💛 - Coveralls |
chore(menu): added tests fix(menu): allow keyboard events to propagate from opened menu
f986c6d
to
47aa1f4
Compare
Tachometer resultsChromeaction-menu permalinktest-basic
test-directive permalink
test-lazy permalink
test-open-close-directive permalink
test-open-close permalink
breadcrumbs permalinkbasic-test
combobox permalinkbasic-test
light-dom-test permalink
menu permalinktest-basic
picker permalinkbasic-test
Firefoxaction-menu permalinktest-basic
test-directive permalink
test-lazy permalink
test-open-close-directive permalink
test-open-close permalink
breadcrumbs permalinkbasic-test
combobox permalinkbasic-test
light-dom-test permalink
menu permalinktest-basic
picker permalinkbasic-test
|
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! 🔥
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.
Let us further discuss if this is the most adequate approach to solving this issue. We are diverging from the native select
element behaviour which, when opened, captures focus and directs keyboard events specifically towards interacting with its options (even though we currently have not implemented the "interacting with its options" part).
Can we check if consumers can solve this on their side by adding an event listener in the capture phase instead of relying solely on the bubbling phase?
Good point, I didn't realize
This would work and was actually my first inclination. I suppose we should speak with accessibility and ask what they think the best behavior is here. |
Hello @lazd, can you confirm if you could solve this on your side? |
Hey @rubencarvalho, unfortunately, we're unable to use a capture listener on our side to work around this bug. This behavior in SWC was actually introduced 4 months ago in a feature PR that was adding support for action menus in action bars, apparently to prevent a potential bug: It was never intentionally added to model behavior after I suggest we merge this PR after testing that the original but this change was meant to address is no longer happening. Thank you! |
Description
An opened sp-menu should allow application keyboard shortcuts.
Related issue(s)
Motivation and context
An opened sp-menu doesn't allow application keyboard shortcuts, stopping the propagation of almost all keydown events.
How has this been tested?
Added a test and it passed ;)
Did it pass in Desktop?
Did it pass in Mobile?
Did it pass in iPad?
Screenshots (if appropriate)
Types of changes
Checklist
Best practices
This repository uses conventional commit syntax for each commit message; note that the GitHub UI does not use this by default so be cautious when accepting suggested changes. Avoid the "Update branch" button on the pull request and opt instead for rebasing your branch against
main
.