diff --git a/src/App.vue b/src/App.vue index efd64cb..2b99519 100644 --- a/src/App.vue +++ b/src/App.vue @@ -38,9 +38,21 @@ const activeFrame = computed(() => { : previewFrame2.value; }); -// Handle keyboard shortcuts (Cmd/Ctrl+S for save) +// Handle keyboard shortcuts const handleKeyboardShortcut = (event) => { - // Check for Cmd+S (Mac) or Ctrl+S (Windows/Linux) + // Escape key - close any open popup + if (event.key === 'Escape') { + if (elementPopup.value?.visible) { + elementPopup.value.close(); + return; + } + if (pagePopup.value?.visible) { + pagePopup.value.close(); + return; + } + } + + // Cmd+S (Mac) or Ctrl+S (Windows/Linux) - save if ((event.metaKey || event.ctrlKey) && event.key === 's') { event.preventDefault();