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

Commit d50d41f

Browse files
committed
fix: props.strategy for floatingui elements not being reactive
1 parent 6fce71b commit d50d41f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ import {
6666
useFloating,
6767
} from '@floating-ui/vue'
6868
import {onClickOutside, useToNumber, useVModel} from '@vueuse/core'
69-
import {computed, provide, ref, watch} from 'vue'
69+
import {computed, provide, ref, toRef, watch} from 'vue'
7070
import {useBooleanish, useId} from '../../composables'
7171
import type {Booleanish, ButtonType, ButtonVariant, ClassValue, Size} from '../../types'
7272
import {BvEvent, dropdownInjectionKey, resolveFloatingPlacement} from '../../utils'
@@ -238,7 +238,7 @@ const floatingMiddleware = computed<Middleware[]>(() => {
238238
const {x, y, strategy, update} = useFloating(referencePlacement, floating, {
239239
placement: floatingPlacement,
240240
middleware: floatingMiddleware,
241-
strategy: props.strategy,
241+
strategy: toRef(props, 'strategy'),
242242
whileElementsMounted: autoUpdate,
243243
})
244244

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ import {
8989
onBeforeUnmount,
9090
onMounted,
9191
ref,
92+
toRef,
9293
type VNode,
9394
watch,
9495
watchEffect,
@@ -309,7 +310,7 @@ const placementRef = computed(() =>
309310
const {x, y, strategy, middlewareData, placement, update} = useFloating(targetTrigger, element, {
310311
placement: placementRef,
311312
middleware: floatingMiddleware,
312-
strategy: props.strategy,
313+
strategy: toRef(props, 'strategy'),
313314
whileElementsMounted: (...args) => {
314315
const cleanup = autoUpdate(...args, {animationFrame: realtimeBoolean.value})
315316
// Important! Always return the cleanup function.

0 commit comments

Comments
 (0)