From 83e16b89a2c95ce72f861bb2057eb5de9782b928 Mon Sep 17 00:00:00 2001 From: Christopher Ng Date: Fri, 27 May 2022 19:21:05 +0000 Subject: Prevent pressing enter key without control focus from activating the primary button Signed-off-by: Christopher Ng --- core/src/jquery/ocdialog.js | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'core/src') diff --git a/core/src/jquery/ocdialog.js b/core/src/jquery/ocdialog.js index 4579f420625..312e52395da 100644 --- a/core/src/jquery/ocdialog.js +++ b/core/src/jquery/ocdialog.js @@ -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 } }) -- cgit v1.2.3