From 1ab3d87e37e3572baef37138707592fe6e808d2d Mon Sep 17 00:00:00 2001 From: Praful Bhawsar Date: Wed, 31 Jan 2024 13:49:39 -0500 Subject: [PATCH] Escape should only trigger Add Core inactivation once --- drawCanvas.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drawCanvas.js b/drawCanvas.js index 960c4e3..14cbbe7 100644 --- a/drawCanvas.js +++ b/drawCanvas.js @@ -941,11 +941,11 @@ function drawCoresOnCanvasForTravelingAlgorithm() { window.viewer.removeAllHandlers("canvas-drag-end") } else { document.addEventListener("keydown", (e) => { - e.preventDefault() if (e.key === 'Escape') { + e.preventDefault() addCoreHandler() } - }) + }, {once: true}) addCoreBtn.classList.add("active") window.viewer.canvas.style.cursor = "crosshair"