From 9185f00287572d1b4daa548d8bb82fd05dd8a911 Mon Sep 17 00:00:00 2001 From: Erik Escoffier Date: Mon, 25 Sep 2023 11:35:39 +0200 Subject: [PATCH] Fix pointer events on new map controls --- app/scripts/components/common/map/controls/coords.tsx | 2 ++ app/scripts/components/common/map/mapbox-style-override.ts | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/scripts/components/common/map/controls/coords.tsx b/app/scripts/components/common/map/controls/coords.tsx index 0e5bc2f39..c6ed2a4c7 100644 --- a/app/scripts/components/common/map/controls/coords.tsx +++ b/app/scripts/components/common/map/controls/coords.tsx @@ -11,8 +11,10 @@ import { CopyField } from '$components/common/copy-field'; const MapCoordsWrapper = styled.div` /* Large width so parent will wrap */ width: 100vw; + pointer-events: none !important; ${Button} { + pointer-events: auto; background: ${themeVal('color.base-400a')}; font-weight: ${themeVal('type.base.regular')}; font-size: 0.75rem; diff --git a/app/scripts/components/common/map/mapbox-style-override.ts b/app/scripts/components/common/map/mapbox-style-override.ts index 51eef4f64..00c7067a4 100644 --- a/app/scripts/components/common/map/mapbox-style-override.ts +++ b/app/scripts/components/common/map/mapbox-style-override.ts @@ -27,11 +27,15 @@ const MapboxStyleOverride = css` gap: ${variableGlsp(0.5)}; align-items: flex-start; float: none; - pointer-events: auto; } .mapboxgl-ctrl { margin: 0; + pointer-events: none; + + > * { + pointer-events: auto; + } } .mapboxgl-ctrl-attrib {