From 0807b42e871867d2dcef2fc6b1a5b704069f84a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 10 Jun 2024 18:01:03 +0200 Subject: [PATCH] Do not run menu action if the menuitem is disabled The click event can still be triggered by the shortcut or event by clicking on the disabled menuitem. So the callback must not run the action if the menuitem is disabled. Closes #13326 --- sao/src/tab.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sao/src/tab.js b/sao/src/tab.js index c0c2c24cb9..82eba21252 100644 --- a/sao/src/tab.js +++ b/sao/src/tab.js @@ -158,7 +158,9 @@ this.menu_buttons[item.id] = menuitem; link.click(evt => { evt.preventDefault(); - this[item.id](); + if (!menuitem.hasClass('disabled')) { + this[item.id](); + } }); } else if (!item && previous) { menuitem = jQuery('
  • ', {