From 4508a121881d5aef31479a96a11cab4783ac48ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Thu, 30 Aug 2018 10:25:09 +0200 Subject: [PATCH] Prevent default action from being executed when the button is disabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When "enter" is pressed in the file picker a "click" event is triggered on the primary action button. However, in some cases, like when the file picker is in "Choose" mode and the current directory in the file picker is the root folder, the primary action button is disabled. In those cases pressing enter should not trigger a click action on the button and be ignored instead. Signed-off-by: Daniel Calviño Sánchez --- core/js/jquery.ocdialog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/js/jquery.ocdialog.js b/core/js/jquery.ocdialog.js index f3a54119e7..02bd3069c5 100644 --- a/core/js/jquery.ocdialog.js +++ b/core/js/jquery.ocdialog.js @@ -64,7 +64,7 @@ self.$buttonrow.find($(event.target)).length === 0 ) { var $button = self.$buttonrow.find('button.primary'); - if($button) { + if($button && !$button.prop('disabled')) { $button.trigger('click'); } } else if(self.$buttonrow) {