Merge pull request #156 from trails-cool/fix/nogo-button-click-through

Fix no-go area button click creating a waypoint
This commit is contained in:
Ullrich Schäfer 2026-04-03 10:40:05 +01:00 committed by GitHub
commit 237660db5e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -170,8 +170,15 @@ function CursorTracker({ awareness }: { awareness: YjsState["awareness"] }) {
}
function NoGoAreaButton({ active, onClick }: { active: boolean; onClick: () => void }) {
const ref = useRef<HTMLDivElement>(null);
// Prevent clicks from reaching the Leaflet map (same as built-in controls)
useEffect(() => {
if (ref.current) L.DomEvent.disableClickPropagation(ref.current);
}, []);
return (
<div className="leaflet-top leaflet-left" style={{ marginTop: 80 }}>
<div ref={ref} className="leaflet-top leaflet-left" style={{ marginTop: 80 }}>
<div className="leaflet-control leaflet-bar">
<a
href="#"