diff --git a/frontend/src/component/bottomsheet/BottomSheet.tsx b/frontend/src/component/bottomsheet/BottomSheet.tsx index 6804908..358273d 100644 --- a/frontend/src/component/bottomsheet/BottomSheet.tsx +++ b/frontend/src/component/bottomsheet/BottomSheet.tsx @@ -56,6 +56,32 @@ export const BottomSheet = ({ setSheetHeight(minHeight); }; + const [, setScrollPosition] = useState(0); + const [touchStartY, setTouchStartY] = useState(null); + + const handleContentTouchStart = (e: React.TouchEvent) => { + setTouchStartY(e.touches[0].clientY); + }; + + const handleContentTouchMove = (e: React.TouchEvent) => { + if (touchStartY !== null) { + const deltaY = e.touches[0].clientY - touchStartY; + + const scrollableElement = e.currentTarget; // 현재 스크롤이 가능한 요소 + const newScrollPosition = scrollableElement.scrollTop - deltaY; + + scrollableElement.scrollTop = newScrollPosition; + + setTouchStartY(e.touches[0].clientY); + + setScrollPosition(newScrollPosition); + } + }; + + const handleContentTouchEnd = () => { + setTouchStartY(null); + }; + return (
e.stopPropagation()} + onTouchMove={e => e.stopPropagation()} + onTouchEnd={e => e.stopPropagation()} >
-
{children}
+
+ {children} +
); }; diff --git a/frontend/src/component/canvasWithMap/canvasWithMapForView/MapCanvasForView.tsx b/frontend/src/component/canvasWithMap/canvasWithMapForView/MapCanvasForView.tsx index 78c4c4a..ae22b97 100644 --- a/frontend/src/component/canvasWithMap/canvasWithMapForView/MapCanvasForView.tsx +++ b/frontend/src/component/canvasWithMap/canvasWithMapForView/MapCanvasForView.tsx @@ -4,7 +4,6 @@ import { useCanvasInteraction } from '@/hooks/useCanvasInteraction'; import { useRedrawCanvas } from '@/hooks/useRedraw'; import { ZoomSlider } from '@/component/zoomslider/ZoomSlider'; import { ICluster, useCluster } from '@/hooks/useCluster'; -import { DEFAULT_ZOOM, MIN_ZOOM } from '@/lib/constants/mapConstants.ts'; export const MapCanvasForView = forwardRef( ({ lat, lng, alpha, otherLocations, guests, width, height }: IMapCanvasViewProps, ref) => { @@ -22,8 +21,8 @@ export const MapCanvasForView = forwardRef { mapInstance.destroy(); }; - }, []); + }, [lat, lng]); const latLngToCanvasPoint = (latLng: IPoint): ICanvasPoint | null => { if (!map || !projection || !canvasRef.current) return null; @@ -146,13 +145,14 @@ export const MapCanvasForView = forwardRef