Merge pull request #16921 from nextcloud/backport/16863/stable16-ignore-enter-key-up-event-on-menu-button-toggles

[stable16] Ignore Enter key up event on menu button toggles
This commit is contained in:
Roeland Jago Douma 2019-08-29 19:15:02 +02:00 committed by GitHub
commit 85756b9348
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -640,9 +640,9 @@ Object.assign(window.OC, {
var self = this;
$menuEl.addClass('menu');
// On link, the enter key trigger a click event
// On link and button, the enter key trigger a click event
// Only use the click to avoid two fired events
$toggle.on($toggle.prop('tagName') === 'A'
$toggle.on(($toggle.prop('tagName') === 'A' || $toggle.prop('tagName') === 'BUTTON')
? 'click.menu'
: 'click.menu keyup.menu', function(event) {
// prevent the link event (append anchor to URL)