From bba34a576b87cf058b83188819c46f2ea7e4f267 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 5 Apr 2021 03:46:23 +0100 Subject: [PATCH] js: Disable drag-and-drop Sometimes, but not always, I can trigger this; the card icon starts floating about weirdly, the JS doesn't get a mouseup event, etc., Empirically this code seems enough to stop it. Signed-off-by: Ian Jackson --- templates/script.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/templates/script.ts b/templates/script.ts index 5fafffde..4aae898c 100644 --- a/templates/script.ts +++ b/templates/script.ts @@ -1809,6 +1809,10 @@ function startup() { } recompute_keybindings(); space.addEventListener('mousedown', some_mousedown); + space.addEventListener('dragstart', function (e) { + e.preventDefault(); + e.stopPropagation(); + }, true); document.addEventListener('keydown', some_keydown); } -- 2.30.2