Skip to content

Commit

Permalink
fix google#6274: Move delete keyboard shortcut in-progress gesture ch…
Browse files Browse the repository at this point in the history
…eck to precondition
  • Loading branch information
humera811 committed Sep 22, 2023
1 parent a04a097 commit d8993f9
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions core/shortcut_items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ export function registerDelete() {
return (
!workspace.options.readOnly &&
selected != null &&
selected.isDeletable()
selected.isDeletable() &&
!Gesture.inProgress()
);
},
callback(workspace, e) {
Expand All @@ -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;
},
Expand Down

0 comments on commit d8993f9

Please sign in to comment.