-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Ignore Enter key up event on menu button toggles #16863
Ignore Enter key up event on menu button toggles #16863
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.
Make sense :)
The fix can be tested by clicking twice in the three dots button next to the call button in nextcloud/spreed#2122 |
Like links, buttons generate a "click" event as well as the regular "keydown" and "keyup" events when pressing Enter. Due to this, if both the "click" and the "keyup" events are handled, when the menu is open and Enter is pressed in the toggle the menu is first hidden when the first event is handled, but then shown again when the second event is handled. To prevent that only the "click" event should be handled when the toggle is a button, like it is already done with links. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
f7f585c
to
cb93af6
Compare
Rebased and ready to go 🚀 |
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.
Fixes the issue in talk
Like links, buttons generate a
click
event as well as the regularkeydown
andkeyup
events when pressing Enter. Due to this, if both theclick
and thekeyup
events are handled, when the menu is open and Enter is pressed in the toggle the menu is first hidden when the first event is handled, but then shown again when the second event is handled. To prevent that only theclick
event should be handled, like already done with links.I would backport this to stable16 (although manually, as the sources changed in Nextcloud 17).