Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FE][Feat] : 검색창,zoomslider에서 이벤트 버블링 방지 #432

Merged
merged 4 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,6 @@ export const MapProviderForDraw = ({ width, height }: ICanvasScreenProps) => {
};
}, []);

useEffect(() => {
const preventDefault = (e: TouchEvent) => {
e.preventDefault();
};

document.body.style.overflow = 'hidden';
document.addEventListener('touchmove', preventDefault, { passive: false });

return () => {
document.body.style.overflow = 'auto';
document.removeEventListener('touchmove', preventDefault);
};
}, []);

return (
<MapCanvasForDraw
width={windowSize.width}
Expand Down
8 changes: 7 additions & 1 deletion frontend/src/component/searchbox/SearchBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,13 @@ export const SearchBox = (props: ISearchBoxProps) => {
};

return (
<div className="absolute top-2 z-[6000] w-full px-2">
<div
className="absolute top-2 z-[6000] w-full px-2"
onTouchMove={e => {
e.stopPropagation();
e.preventDefault();
}}
>
{/* 검색 입력 */}
<div className="border-grayscale-75 text-grayscale-400 flex h-11 w-full rounded border bg-white px-3">
<input
Expand Down
8 changes: 7 additions & 1 deletion frontend/src/component/zoomslider/ZoomSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,13 @@ export const ZoomSlider = ({ map, redrawCanvas }: IZoomSliderProps) => {
};

return (
<div className="flex h-48 w-9 flex-col items-center rounded bg-white shadow">
<div
className="flex h-48 w-9 flex-col items-center rounded bg-white shadow"
onTouchMove={e => {
e.stopPropagation();
e.preventDefault();
}}
>
<ZoomButton label={<MdOutlineAdd />} onClick={() => handleZoomChange(1)} />
<ZoomSliderInput zoomLevel={zoomLevel} onSliderChange={handleSliderChange} />
<ZoomButton label={<MdRemove />} onClick={() => handleZoomChange(-1)} />
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/DrawRoute.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export const DrawRoute = () => {
return (
<ToolTypeProvider>
<div className="flex h-full w-full flex-col py-[75px]">
<div style={{ position: 'relative', padding: '1rem' }}>
<div className="relative px-4">
<MapProviderForDraw width={window.innerWidth - 32} height={window.innerHeight - 180} />
</div>
</div>
Expand Down
Loading