From 05eb3508bcaf5d0a5ceceb2a5a16805d9aa20a8a Mon Sep 17 00:00:00 2001 From: Muthu Kumar Date: Wed, 4 Oct 2023 04:04:04 +0530 Subject: [PATCH] fix: scroll locking bug Signed-off-by: Muthu Kumar --- src/components/Container.tsx | 11 +++-------- src/index.css | 16 +++++++--------- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/src/components/Container.tsx b/src/components/Container.tsx index 46dd3c6..9775085 100644 --- a/src/components/Container.tsx +++ b/src/components/Container.tsx @@ -82,11 +82,6 @@ const Container: React.FC<{ child.style.removeProperty("transform"); }, 100 * idx); }); - - timer(() => { - document.body.style.maxHeight = "auto"; - document.body.style.overflow = "auto"; - }, containerChildren.length * 100); } // cleanup @@ -118,8 +113,7 @@ const Container: React.FC<{ child.style.opacity = "0"; }); } - document.body.style.maxHeight = "100vh"; - document.body.style.overflow = "hidden"; + try { const target = e.currentTarget! as HTMLButtonElement; target.style.width = "0"; @@ -167,11 +161,12 @@ const Container: React.FC<{ padding-block-start: 15rem; padding-block-end: 8rem; padding-inline: calc(100vw / 8); - overflow-x: hidden; + overflow: hidden; min-height: 100vh; position: relative; `}>