From 8ce41ec09827b1418b4534fe92227363fcbfe9b0 Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Sun, 12 Oct 2025 09:29:03 +0200 Subject: [PATCH] fix close button in SelectPosition --- .../Map/Subcomponents/SelectPosition.tsx | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/lib/src/Components/Map/Subcomponents/SelectPosition.tsx b/lib/src/Components/Map/Subcomponents/SelectPosition.tsx index 7b3727af..1aed12c0 100644 --- a/lib/src/Components/Map/Subcomponents/SelectPosition.tsx +++ b/lib/src/Components/Map/Subcomponents/SelectPosition.tsx @@ -1,3 +1,6 @@ +import { DomEvent } from 'leaflet' +import { useEffect, useRef } from 'react' + import type { Item } from '#types/Item' import type { LayerProps } from '#types/LayerProps' @@ -8,11 +11,25 @@ export const SelectPosition = ({ setSelectNewItemPosition: React.Dispatch> selectNewItemPosition?: Item | LayerProps | null }) => { + const containerRef = useRef(null) + + useEffect(() => { + if (containerRef.current) { + DomEvent.disableClickPropagation(containerRef.current) + DomEvent.disableScrollPropagation(containerRef.current) + } + }, []) + return ( -
+