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

Ignore Enter key up event on menu button toggles #16863

Merged
merged 1 commit into from
Aug 28, 2019

Conversation

danxuliu
Copy link
Member

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, like already done with links.

I would backport this to stable16 (although manually, as the sources changed in Nextcloud 17).

@danxuliu danxuliu added this to the Nextcloud 17 milestone Aug 26, 2019
Copy link
Member

@skjnldsv skjnldsv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense :)

@danxuliu
Copy link
Member Author

The fix can be tested by clicking twice in the three dots button next to the call button in nextcloud/spreed#2122

@rullzer rullzer mentioned this pull request Aug 28, 2019
@skjnldsv skjnldsv added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Aug 28, 2019
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>
@skjnldsv skjnldsv force-pushed the ignore-enter-key-up-event-on-menu-button-toggles branch from f7f585c to cb93af6 Compare August 28, 2019 07:46
@skjnldsv
Copy link
Member

Rebased and ready to go 🚀

Copy link
Member

@nickvergessen nickvergessen left a 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

@rullzer rullzer merged commit 907a6b4 into master Aug 28, 2019
@rullzer rullzer deleted the ignore-enter-key-up-event-on-menu-button-toggles branch August 28, 2019 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants