mirror of
https://github.com/nextcloud/server.git
synced 2026-04-23 15:21:00 -04:00
Prevent pressing enter key without control focus from activating the primary button
Signed-off-by: Christopher Ng <chrng8@gmail.com>
This commit is contained in:
parent
fc56c0eb91
commit
83e16b89a2
3 changed files with 3 additions and 15 deletions
12
core/src/jquery/ocdialog.js
vendored
12
core/src/jquery/ocdialog.js
vendored
|
|
@ -92,18 +92,6 @@ $.widget('oc.ocdialog', {
|
|||
event.preventDefault()
|
||||
return false
|
||||
}
|
||||
// If no button is selected we trigger the primary
|
||||
if (
|
||||
self.$buttonrow
|
||||
&& self.$buttonrow.find($(event.target)).length === 0
|
||||
) {
|
||||
const $button = self.$buttonrow.find('button.primary')
|
||||
if ($button && !$button.prop('disabled')) {
|
||||
$button.trigger('click')
|
||||
}
|
||||
} else if (self.$buttonrow) {
|
||||
$(event.target).trigger('click')
|
||||
}
|
||||
return false
|
||||
}
|
||||
})
|
||||
|
|
|
|||
4
dist/core-main.js
vendored
4
dist/core-main.js
vendored
File diff suppressed because one or more lines are too long
2
dist/core-main.js.map
vendored
2
dist/core-main.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue