Skip to content

Commit

Permalink
* zin: fix disableScroll not work.
Browse files Browse the repository at this point in the history
  • Loading branch information
catouse committed Feb 29, 2024
1 parent e347e60 commit e978276
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/core/src/helpers/scroll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit e978276

Please sign in to comment.