From e978276520ababea9a180be85fc53280eb50b9d0 Mon Sep 17 00:00:00 2001 From: sunhao Date: Thu, 29 Feb 2024 14:22:23 +0800 Subject: [PATCH] * zin: fix disableScroll not work. --- lib/core/src/helpers/scroll.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core/src/helpers/scroll.ts b/lib/core/src/helpers/scroll.ts index 2162e23746..3684ec5df2 100644 --- a/lib/core/src/helpers/scroll.ts +++ b/lib/core/src/helpers/scroll.ts @@ -20,7 +20,7 @@ export function disableScroll(selector: Selector, disable = true): void { $element.data(dataName, {overflow: $element.css('overflow')}).css('overflow', 'hidden'); return; } - const scrollbarWidth = (element === document.body) ? (window.innerWidth - document.body.clientWidth) : (element.offsetWidth - element.clientWidth); + const scrollbarWidth = (element === document.body || $element.is('html')) ? (window.innerWidth - document.body.clientWidth) : (element.offsetWidth - element.clientWidth); if (!scrollbarWidth) { return; }