This commit is contained in:
konnorrogers
2024-07-23 12:35:31 -04:00
parent 5ca390b97d
commit 83fc577ccd
2 changed files with 2 additions and 2 deletions

View File

@@ -1761,4 +1761,4 @@ The following pages demonstrate why this change was necessary.
## 2.0.0-beta.1
- Initial release
- Initial release

View File

@@ -44,7 +44,7 @@ export function lockBodyScrolling(lockingEl: HTMLElement) {
/** Sometimes the scrollbar width is 1px, even then, we assume nothing is overflowing. */
if (scrollbarWidth < 2) {
// if there's no scrollbar, just set it to an empty string so whatever the user has set gets used. This is useful if the page is not overflowing and showing a scrollbar, or if the user has overflow: hidden, or any other reason a scrollbar may not be showing.
scrollbarGutterProperty = ""
scrollbarGutterProperty = '';
}
document.documentElement.style.setProperty('--sl-scroll-lock-gutter', scrollbarGutterProperty);
document.documentElement.classList.add('sl-scroll-lock');