From 35523fd8ce48f89b7f2f717e0c8092dd7213eb05 Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Mon, 20 Apr 2020 16:45:33 +1000 Subject: [PATCH] Fix grid off and on icons not being selectable --- src/components/MapControls.js | 32 +++++++++++++++++--------------- src/icons/GridOffIcon.js | 2 ++ src/icons/GridOnIcon.js | 2 ++ 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/components/MapControls.js b/src/components/MapControls.js index 3e8716a..cc3ecd8 100644 --- a/src/components/MapControls.js +++ b/src/components/MapControls.js @@ -80,21 +80,23 @@ function MapControls({ ":active": { color: "secondary" }, }} > - onBrushGridSnappingChange(!useBrushGridSnapping)} - > - {useBrushGridSnapping ? : } - + {useBrushGridSnapping ? ( + onBrushGridSnappingChange(false)} + > + + + ) : ( + onBrushGridSnappingChange(true)} + > + + + )} Grid Lock diff --git a/src/icons/GridOffIcon.js b/src/icons/GridOffIcon.js index a1287c2..d7b2950 100644 --- a/src/icons/GridOffIcon.js +++ b/src/icons/GridOffIcon.js @@ -8,6 +8,8 @@ function GridOffIcon() { viewBox="0 0 24 24" width="24" fill="currentcolor" + // Fixes bug with not firing click event when used in a button + style={{ pointerEvents: "none" }} > diff --git a/src/icons/GridOnIcon.js b/src/icons/GridOnIcon.js index 1796b30..0511b25 100644 --- a/src/icons/GridOnIcon.js +++ b/src/icons/GridOnIcon.js @@ -8,6 +8,8 @@ function GridOnIcon() { viewBox="0 0 24 24" width="24" fill="currentcolor" + // Fixes bug with not firing click event when used in a button + style={{ pointerEvents: "none" }} >