Skip to content

Commit

Permalink
fix(comp:tooltip): visible is not work when destroyOnHide is true (#1550
Browse files Browse the repository at this point in the history
)
  • Loading branch information
liuzaijiang authored May 13, 2023
1 parent 64d9a34 commit 05fdb30
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/components/_private/overlay/src/Overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,18 @@ export default defineComponent({
onMounted(() => initialize())
onBeforeUnmount(() => destroy())

watch(visibility, value => callEmit(props['onUpdate:visible'], value))
watch(visibility, value => {
if (value && props.destroyOnHide) {
initialize()
}
callEmit(props['onUpdate:visible'], value)
})
watch(placement, value => callEmit(props['onUpdate:placement'], value))
watch(popperOptions, options => update(options))
watch(
() => props.visible,
visible => {
visible ? show() : hide()
if (visible && props.destroyOnHide) {
initialize()
}
},
{ flush: 'post' },
)
Expand Down

0 comments on commit 05fdb30

Please sign in to comment.