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:
commit
237660db5e
1 changed files with 8 additions and 1 deletions
|
|
@ -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="#"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue