From c6f932691d386eba7325d1f96417b59e7a6019ee Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 13 Apr 2021 23:41:22 +0100 Subject: [PATCH] js: Properly handle shift-click deselection Signed-off-by: Ian Jackson --- templates/script.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/templates/script.ts b/templates/script.ts index fd309091..60b07c41 100644 --- a/templates/script.ts +++ b/templates/script.ts @@ -987,6 +987,13 @@ function drag_mousedown(e : MouseEvent, shifted: boolean) { drag_pieces = []; if (held == us) { + if (shifted) { + for (let tpiece of clicked) { + let tp = pieces[tpiece]!; + do_ungrab(tpiece,tp); + } + return; + } dragging = DRAGGING.MAYBE_UNGRAB; // contrive to have these first for (let piece of clicked) { -- 2.30.2