From fafea39e36546732ea2ad9d01434225ad07a81c8 Mon Sep 17 00:00:00 2001 From: Warren Parad Date: Fri, 5 Mar 2021 17:26:00 +0100 Subject: [PATCH] Fix check for isBodyOverflowing --- src/components/modal/helpers/modal-manager.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/modal/helpers/modal-manager.js b/src/components/modal/helpers/modal-manager.js index af4e23a9fa0..dd5eacea8e5 100644 --- a/src/components/modal/helpers/modal-manager.js +++ b/src/components/modal/helpers/modal-manager.js @@ -139,9 +139,10 @@ const ModalManager = /*#__PURE__*/ Vue.extend({ } }, checkScrollbar() { - // Determine if the body element is overflowing - const { left, right } = getBCR(document.body) - this.isBodyOverflowing = left + right < window.innerWidth + const overflowStyle = getCS(document.body).overflowY + this.isBodyOverflowing = + (overflowStyle === 'auto' || overflowStyle === 'scroll') && + document.body.scrollHeight > window.innerHeight }, setScrollbar() { const body = document.body