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

Commit 65d25fa

Browse files
authored
fix(BOffcanvas): import BButton (bootstrap-vue-next#1359)
fix(BOffcanvas): import BButton
1 parent 2f563db commit 65d25fa

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

packages/bootstrap-vue-next/src/components/BOffcanvas/BOffcanvas.vue

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ import {BvTriggerableEvent, isEmptySlot} from '../../utils'
7777
import BOverlay from '../BOverlay/BOverlay.vue'
7878
import BCloseButton from '../BButton/BCloseButton.vue'
7979
import BTransition from '../BTransition/BTransition.vue'
80+
import BButton from '../BButton/BButton.vue'
8081
8182
// TODO once the responsive stuff may be implemented correctly,
8283
// What needs to occur is a fixing of the "body scrolling".
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
1-
import {computed, type MaybeRefOrGetter, onMounted, readonly, ref, toRef, watch} from 'vue'
1+
import {computed, type MaybeRefOrGetter, onMounted, readonly, toRef, watch} from 'vue'
22
import {useScrollLock} from '@vueuse/core'
33

44
export default (isOpen: MaybeRefOrGetter<boolean>, bodyScroll: MaybeRefOrGetter<boolean>) => {
5-
const modelValue = readonly(toRef(isOpen))
6-
const bodyScrollingValue = readonly(toRef(bodyScroll))
5+
const resolvedIsOpen = readonly(toRef(isOpen))
6+
const resolvedBodyScrolling = readonly(toRef(bodyScroll))
77

88
/**
99
* We use the inverse because bodyScrolling === true means we allow scrolling, while bodyScrolling === false means we disallow
1010
*/
11-
const inverseBodyScrollingValue = computed(() => !bodyScrollingValue.value)
12-
13-
const bodyRef = ref<HTMLElement | null>(null)
11+
const inverseBodyScrollingValue = computed(() => !resolvedBodyScrolling.value)
1412

1513
onMounted(() => {
16-
bodyRef.value = document.body
17-
})
18-
19-
const isLocked = useScrollLock(bodyRef, modelValue.value && inverseBodyScrollingValue.value)
14+
const isLocked = useScrollLock(
15+
document.body,
16+
resolvedIsOpen.value && inverseBodyScrollingValue.value
17+
)
2018

21-
watch([modelValue, inverseBodyScrollingValue], ([modelVal, bodyVal]) => {
22-
isLocked.value = modelVal && bodyVal
19+
watch([resolvedIsOpen, inverseBodyScrollingValue], ([modelVal, bodyVal]) => {
20+
isLocked.value = modelVal && bodyVal
21+
})
2322
})
2423
}

0 commit comments

Comments
 (0)