Skip to content

Commit 1a93418

Browse files
authored
fix(useAnimate): Clear animate when element is gone (#4579)
1 parent cd6d7e0 commit 1a93418

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/core/useAnimate/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,12 @@ export function useAnimate(
224224
}
225225

226226
watch(() => unrefElement(target), (el) => {
227-
if (el)
227+
if (el) {
228228
update()
229+
}
230+
else {
231+
animate.value = undefined
232+
}
229233
})
230234

231235
watch(() => keyframes, (value) => {

0 commit comments

Comments
 (0)