From 44385606b93eea9ea9481f7ba85a2fe29578922a Mon Sep 17 00:00:00 2001 From: Maharshi Patel Date: Thu, 19 Sep 2024 17:16:19 +0530 Subject: [PATCH] fix(minor): revert keybinding changes not sure why but i believe focus element is different in some cases which is causing keybinding to not work so reverted changes from #344. --- .../js/print_designer/composables/AttachKeyBindings.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/print_designer/public/js/print_designer/composables/AttachKeyBindings.js b/print_designer/public/js/print_designer/composables/AttachKeyBindings.js index d7edc2f..682d588 100644 --- a/print_designer/public/js/print_designer/composables/AttachKeyBindings.js +++ b/print_designer/public/js/print_designer/composables/AttachKeyBindings.js @@ -45,7 +45,13 @@ export function useAttachKeyBindings() { const handleKeyDown = async (e) => { MainStore.isAltKey = e.altKey; MainStore.isShiftKey = e.shiftKey; - if (!e.target.classList.contains("print-format-container") || MainStore.openModal) return; + if ( + !( + e.target.classList.contains("print-format-container") || e.target == document.body + ) || + MainStore.openModal + ) + return; if (e.ctrlKey || e.metaKey) { if (["a", "A"].indexOf(e.key) != -1) { ElementStore.Elements.forEach((page) => {