You may have noticed the demo page is not working as expected, it seems only the initial motion variant is triggered. While testing #171 in the vite playground I noticed that simply adding en element using a visibility variant would make all motion elements disappear.
Using the Netlify deploy history of the demo page (https://app.netlify.com/sites/vueuse-motion-demo/deploys) I narrowed down when this broke to this commit. I think that by changing the directive to accept a default value {} instead of undefined for variants, the same object is being reused for all v-motion usage, essentially each element using v-motion is overwriting/merging all the previous ones.
This partially fixes the demo page, but fixes what's probably a bigger bug. I'll have a separate PR to fix the demo page further soon.
You may have noticed the demo page is not working as expected, it seems only the initial motion variant is triggered. While testing #171 in the vite playground I noticed that simply adding en element using a visibility variant would make all motion elements disappear.
Using the Netlify deploy history of the demo page (https://app.netlify.com/sites/vueuse-motion-demo/deploys) I narrowed down when this broke to this commit. I think that by changing the directive to accept a default value
{}
instead of undefined for variants, the same object is being reused for allv-motion
usage, essentially each element usingv-motion
is overwriting/merging all the previous ones.This partially fixes the demo page, but fixes what's probably a bigger bug. I'll have a separate PR to fix the demo page further soon.