From 9f21f895bac45649be25ec5a9ac75618d050269b Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Fri, 22 May 2020 17:25:17 +1000 Subject: [PATCH] Disable map interaction in map selection modal --- src/components/map/SelectMapButton.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/map/SelectMapButton.js b/src/components/map/SelectMapButton.js index fb8c81f..f397a89 100644 --- a/src/components/map/SelectMapButton.js +++ b/src/components/map/SelectMapButton.js @@ -5,6 +5,7 @@ import SelectMapModal from "../../modals/SelectMapModal"; import SelectMapIcon from "../../icons/SelectMapIcon"; import MapDataContext from "../../contexts/MapDataContext"; +import MapInteractionContext from "../../contexts/MapInteractionContext"; function SelectMapButton({ onMapChange, @@ -14,13 +15,16 @@ function SelectMapButton({ }) { const [isModalOpen, setIsModalOpen] = useState(false); + const { setPreventMapInteraction } = useContext(MapInteractionContext); const { updateMapState } = useContext(MapDataContext); function openModal() { currentMapState && updateMapState(currentMapState.mapId, currentMapState); setIsModalOpen(true); + setPreventMapInteraction(true); } function closeModal() { setIsModalOpen(false); + setPreventMapInteraction(false); } function handleDone() {