From 112d1ae78a4316e7b8dc927f38d91acd1772bab7 Mon Sep 17 00:00:00 2001 From: humera811 Date: Fri, 22 Sep 2023 12:09:07 -0700 Subject: [PATCH] Fix: Move delete keyboard shortcut in-progress gesture check to precondition --- core/shortcut_items.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/core/shortcut_items.ts b/core/shortcut_items.ts index 57b90a498..12b08b583 100644 --- a/core/shortcut_items.ts +++ b/core/shortcut_items.ts @@ -59,7 +59,8 @@ export function registerDelete() { return ( !workspace.options.readOnly && selected != null && - selected.isDeletable() + selected.isDeletable() && + !Gesture.inProgress() ); }, callback(workspace, e) { @@ -68,10 +69,6 @@ export function registerDelete() { // Do this first to prevent an error in the delete code from resulting in // data loss. e.preventDefault(); - // Don't delete while dragging. Jeez. - if (Gesture.inProgress()) { - return false; - } (common.getSelected() as BlockSvg).checkAndDelete(); return true; },