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"