From: Ian Jackson Date: Mon, 5 Apr 2021 02:46:23 +0000 (+0100) Subject: js: Disable drag-and-drop X-Git-Tag: otter-0.5.0~183 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=bba34a576b87cf058b83188819c46f2ea7e4f267;p=otter.git 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 --- 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); }