Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Commit 88aae2d

Browse files
committed
perf(usseSafeScrollLock): use document.body over document.querySelector('body')
1 parent a5952b7 commit 88aae2d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/bootstrap-vue-next/src/composables/useSafeScrollLock.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ export default (isOpen: MaybeRefOrGetter<boolean>, bodyScroll: MaybeRefOrGetter<
1010
*/
1111
const inverseBodyScrollingValue = computed(() => !bodyScrollingValue.value)
1212

13-
const bodyRef = ref<HTMLBodyElement | null>(null)
13+
const bodyRef = ref<HTMLElement | null>(null)
1414

1515
onMounted(() => {
16-
bodyRef.value = document.querySelector('body')
16+
bodyRef.value = document.body
1717
})
1818

1919
const isLocked = useScrollLock(bodyRef, modelValue.value && inverseBodyScrollingValue.value)

0 commit comments

Comments
 (0)