diff --git a/chrome_11eKLevsrE.png b/chrome_11eKLevsrE.png new file mode 100644 index 0000000..56091d3 Binary files /dev/null and b/chrome_11eKLevsrE.png differ diff --git a/client/src/components/CatModal.tsx b/client/src/components/CatModal.tsx index c447965..59cd751 100644 --- a/client/src/components/CatModal.tsx +++ b/client/src/components/CatModal.tsx @@ -35,19 +35,15 @@ export default function CatModal({ catId, onClose }: CatModalProps) { 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.position = 'fixed'; - document.body.style.top = `-${scrollY}px`; - document.body.style.left = '0'; - document.body.style.right = '0'; - document.body.style.width = '100%'; + document.body.style.height = '100%'; return () => { + document.documentElement.style.overflow = ''; + document.documentElement.style.height = ''; document.body.style.overflow = ''; - document.body.style.position = ''; - document.body.style.top = ''; - document.body.style.left = ''; - document.body.style.right = ''; - document.body.style.width = ''; + document.body.style.height = ''; window.scrollTo(0, scrollY); }; }, []);