From 6b5445aef2e9a4d8431c0fd6790884ceed3b386f Mon Sep 17 00:00:00 2001 From: Nam Anh Date: Sat, 24 Jun 2023 20:18:34 +0700 Subject: [PATCH] fix(readme): conflict with search page (#524) --- src/components/ReadmePage.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/ReadmePage.tsx b/src/components/ReadmePage.tsx index 5070cfbe..36b6e353 100644 --- a/src/components/ReadmePage.tsx +++ b/src/components/ReadmePage.tsx @@ -71,11 +71,14 @@ class ReadmePage extends React.Component< const main = document.querySelector("#marketplace-readme")?.closest("main"); if (main) { const callScrollbar = setInterval(() => { + if (!document.querySelector("#marketplace-readme")) { + clearInterval(callScrollbar); + main.style.removeProperty("overflow-y"); + return; + } // TODO: see if it's possible to use some load event or mutation observer to do this main.style.overflowY = "visible"; main.style.overflowY = "auto"; - if (!document.querySelector(".os-scrollbar-vertical.os-scrollbar-unusable") || !main) - clearInterval(callScrollbar); }, 1000); }