From 0174acbde0451b7e8185d227b59d5346858a1abb Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Thu, 1 Oct 2020 16:41:57 +1000 Subject: [PATCH] Added open check for shortcuts on map select modal --- src/modals/SelectMapModal.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/modals/SelectMapModal.js b/src/modals/SelectMapModal.js index 7b6897f..afdcf7d 100644 --- a/src/modals/SelectMapModal.js +++ b/src/modals/SelectMapModal.js @@ -362,6 +362,9 @@ function SelectMapModal({ * Shortcuts */ function handleKeyDown({ key }) { + if (!isOpen) { + return; + } if (key === "Shift") { setSelectMode("range"); } @@ -371,6 +374,9 @@ function SelectMapModal({ } function handleKeyUp({ key }) { + if (!isOpen) { + return; + } if (key === "Shift" && selectMode === "range") { setSelectMode("single"); }