Skip to content

Commit

Permalink
Update src/core/script/api/modules/scroll/scroll-locker.js
Browse files Browse the repository at this point in the history
Co-authored-by: lab9 <lab9.fr@gmail.com>
  • Loading branch information
keryanS and lab9fr authored Jun 13, 2023
1 parent f5b7d9d commit 4b25531
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/script/api/modules/scroll/scroll-locker.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ScrollLocker extends Module {
this._scrollY = window.scrollY;
const scrollBarGap = window.innerWidth - document.documentElement.clientWidth;
document.documentElement.setAttribute(ns.attr('scrolling'), 'false');
document.body.style.top = `${this._scrollY * -1}px`;
document.body.style.top = `${-this._scrollY}px`;
this.behavior = getComputedStyle(document.documentElement).getPropertyValue('scroll-behavior');
if (this.behavior === 'smooth') document.documentElement.style.scrollBehavior = 'auto';
if (scrollBarGap > 0) {
Expand Down

0 comments on commit 4b25531

Please sign in to comment.