From 93a09db707cf6566af25564dde3b5a60efee35fd Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Thu, 6 Aug 2020 13:31:46 +1000 Subject: [PATCH] Fix bug that caused closing the select map modal to select the map Added ability to deselect a map by clicking outside of the map select tile --- src/components/map/MapTile.js | 3 ++- src/components/map/MapTiles.js | 1 + src/modals/SelectMapModal.js | 17 +++++++++++++++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/components/map/MapTile.js b/src/components/map/MapTile.js index 6e76a37..c8675d4 100644 --- a/src/components/map/MapTile.js +++ b/src/components/map/MapTile.js @@ -109,7 +109,8 @@ function MapTile({ }} m={2} bg="muted" - onClick={() => { + onClick={(e) => { + e.stopPropagation(); setIsTileMenuOpen(false); if (!isSelected) { onMapSelect(map); diff --git a/src/components/map/MapTiles.js b/src/components/map/MapTiles.js index 88d7961..96060c9 100644 --- a/src/components/map/MapTiles.js +++ b/src/components/map/MapTiles.js @@ -31,6 +31,7 @@ function MapTiles({ width: "500px", borderRadius: "4px", }} + onClick={() => onMapSelect(null)} > + handleImagesUpload(event.target.files)}