From 7eee91516d75c576568745455065f0155f0d41e6 Mon Sep 17 00:00:00 2001 From: mleister97 Date: Tue, 22 Jul 2025 21:27:30 +0200 Subject: [PATCH] [fix] isBodyOverflowing returns false when overflow-y: scroll fixes https://github.com/react-component/portal/issues/25 --- src/util.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util.ts b/src/util.ts index bfdb9a1..2e4aa22 100644 --- a/src/util.ts +++ b/src/util.ts @@ -2,6 +2,9 @@ * Test usage export. Do not use in your production */ export function isBodyOverflowing() { + if (window.getComputedStyle(document.body).overflowY === 'scroll') + return true; + return ( document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight) &&