Skip to content

Commit

Permalink
fix(Popper): use watchEffect for anchor update #1188
Browse files Browse the repository at this point in the history
  • Loading branch information
zumm committed Aug 5, 2024
1 parent e7a253d commit 799bcb2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/radix-vue/src/Popper/PopperAnchor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface PopperAnchorProps extends PrimitiveProps {
</script>

<script setup lang="ts">
import { watch } from 'vue'
import { watchEffect } from 'vue'
import { injectPopperRootContext } from './PopperRoot.vue'
import {
Primitive,
Expand All @@ -21,7 +21,7 @@ const { forwardRef, currentElement } = useForwardExpose()
const rootContext = injectPopperRootContext()
watch(currentElement, () => {
watchEffect(() => {
rootContext.onAnchorChange(props.element ?? currentElement.value)
})
</script>
Expand Down

0 comments on commit 799bcb2

Please sign in to comment.