From 4158513bf4a90b6d9f688973e267b10f652ca2a7 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 29 Jul 2022 11:52:54 +0100 Subject: [PATCH] Fix keybinding order precendence --- .../navigation/ComponentListPanel.svelte | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentListPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentListPanel.svelte index 76d5483be9..b8ce275722 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentListPanel.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentListPanel.svelte @@ -89,23 +89,7 @@ } const component = get(selectedComponent) try { - if (e.key === "Delete") { - // Don't show confirmation for the screen itself - if (component._id === get(selectedScreen).props._id) { - return - } - e.preventDefault() - confirmDeleteDialog.show() - } else if (e.key === "ArrowUp") { - e.preventDefault() - await store.actions.components.selectPrevious() - } else if (e.key === "ArrowDown") { - e.preventDefault() - await store.actions.components.selectNext() - } else if (e.key === "Escape" && $isActive("./new")) { - e.preventDefault() - $goto("./") - } else if (e.ctrlKey) { + if (e.ctrlKey) { if (e.key === "ArrowUp") { e.preventDefault() await store.actions.components.moveUp(component) @@ -125,6 +109,22 @@ e.preventDefault() $goto("./new") } + } else if (e.key === "Delete") { + // Don't show confirmation for the screen itself + if (component._id === get(selectedScreen).props._id) { + return + } + e.preventDefault() + confirmDeleteDialog.show() + } else if (e.key === "ArrowUp") { + e.preventDefault() + await store.actions.components.selectPrevious() + } else if (e.key === "ArrowDown") { + e.preventDefault() + await store.actions.components.selectNext() + } else if (e.key === "Escape" && $isActive("./new")) { + e.preventDefault() + $goto("./") } } catch (error) { console.log(error)