From eadd7bcffefcd025ae9a3a053fbbde226bcc868c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 28 May 2025 18:02:21 +0200 Subject: [PATCH] Do not execute tab shortcuts if there is a modal open The modals are linked to the current tab so we can not change the tab as long as there is a modal. Closes #14042 --- sao/src/sao.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/sao/src/sao.js b/sao/src/sao.js index e88eea4868..9174fd4661 100644 --- a/sao/src/sao.js +++ b/sao/src/sao.js @@ -1084,20 +1084,26 @@ var Sao = { shortcut: 'alt+shift+tab', label: Sao.i18n.gettext('Previous tab'), callback: function() { - Sao.Tab.previous_tab(); + if (!jQuery('body').children('.modal').length) { + Sao.Tab.previous_tab(); + } }, }, { shortcut: 'alt+tab', label: Sao.i18n.gettext('Next tab'), callback: function() { - Sao.Tab.next_tab(); + if (!jQuery('body').children('.modal').length) { + Sao.Tab.next_tab(); + } }, }, { shortcut: 'ctrl+k', label: Sao.i18n.gettext('Global search'), callback: function() { - jQuery('#main_navbar:hidden').collapse('show'); - jQuery('#global-search-entry').focus(); + if (!jQuery('body').children('.modal').length) { + jQuery('#main_navbar:hidden').collapse('show'); + jQuery('#global-search-entry').focus(); + } }, }, { shortcut: 'f1',