From c3eb045af344d472d8609aeff10c168289fda201 Mon Sep 17 00:00:00 2001 From: Marco 'Lubber' Wienkoop Date: Mon, 5 Jun 2023 12:59:15 +0200 Subject: [PATCH] fix(checkbox): prevent readonly toggle via space Prevent a checkbox change via tab+space when it is declared as readonly --- src/definitions/modules/checkbox.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/definitions/modules/checkbox.js b/src/definitions/modules/checkbox.js index cf08195d24..4162a58cb1 100644 --- a/src/definitions/modules/checkbox.js +++ b/src/definitions/modules/checkbox.js @@ -241,7 +241,9 @@ $input.trigger('blur'); shortcutPressed = true; event.stopPropagation(); - } else if (!event.ctrlKey && module.can.change()) { + } else if (!module.can.change()) { + shortcutPressed = true; + } else if (!event.ctrlKey) { if (key === keyCode.space || (key === keyCode.enter && settings.enableEnterKey)) { module.verbose('Enter/space key pressed, toggling checkbox'); module.toggle();