pull/5453/merge
Veeraishvwajith 2 days ago committed by GitHub
commit 3473e03824
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -117,8 +117,13 @@ export function useBodyScrollLock(): WritableComputedRef<boolean> {
const isLocked = shallowRef(false)
let useEvents = false
let scrollY = 0
function lock() {
if (isLocked.value) return
scrollY = window.scrollY
useEvents =
window.innerWidth > document.documentElement.clientWidth &&
!CSS.supports('scrollbar-gutter', 'stable')
@ -130,6 +135,8 @@ export function useBodyScrollLock(): WritableComputedRef<boolean> {
if (!isLocked.value) return
useEvents ? unlockEvents() : unlockOverflow()
isLocked.value = false
window.scrollTo(0, scrollY)
}
onScopeDispose(unlock)

@ -621,3 +621,7 @@
content: '\2060';
color: currentColor;
}
html {
scrollbar-gutter: stable;
}

Loading…
Cancel
Save