diff --git a/print_designer/public/js/print_designer/components/layout/AppPages.vue b/print_designer/public/js/print_designer/components/layout/AppPages.vue index 1f265de..ce40cca 100644 --- a/print_designer/public/js/print_designer/components/layout/AppPages.vue +++ b/print_designer/public/js/print_designer/components/layout/AppPages.vue @@ -120,6 +120,7 @@ const getMarginContainerStyle = computed(() => { onMounted(() => { // TODO: Refactor this as per the new store structure ElementStore.$subscribe((mutation, state) => { + if (!(mutation?.events)) return; if ( (mutation.events.type === "set" && mutation.events.key == "Elements") || (mutation.events.type === "add" && mutation.events.newValue.parent?.type == "page") 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) => {