Fix no-go button click creating a waypoint
The button was rendered as a React component, not a Leaflet control, so clicks propagated to the map. Use L.DomEvent.disableClickPropagation on the container — same approach Leaflet's built-in controls use. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
596d96d8cb
commit
16568ffa45
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 }) {
|
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 (
|
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">
|
<div className="leaflet-control leaflet-bar">
|
||||||
<a
|
<a
|
||||||
href="#"
|
href="#"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue