diff --git a/client/src/components/CatModal.tsx b/client/src/components/CatModal.tsx index a5b170c..59cf368 100644 --- a/client/src/components/CatModal.tsx +++ b/client/src/components/CatModal.tsx @@ -34,18 +34,8 @@ export default function CatModal({ catId, onClose }: CatModalProps) { useEffect(() => { if (likeData) setLiked(likeData.liked); }, [likeData]); useEffect(() => { if (data?.cat) setLikeCount(data.cat.likes_count); }, [data]); useEffect(() => { - const scrollY = window.scrollY; - document.documentElement.style.overflow = 'hidden'; - document.documentElement.style.height = '100%'; document.body.style.overflow = 'hidden'; - document.body.style.height = '100%'; - return () => { - document.documentElement.style.overflow = ''; - document.documentElement.style.height = ''; - document.body.style.overflow = ''; - document.body.style.height = ''; - window.scrollTo(0, scrollY); - }; + return () => { document.body.style.overflow = ''; }; }, []); useEffect(() => { const h = (e: KeyboardEvent) => { if (e.key === 'Escape') onClose(); }; @@ -108,9 +98,9 @@ export default function CatModal({ catId, onClose }: CatModalProps) { }); return ( -
+
e.stopPropagation()} >