Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: v-motion directive variants leaking #173

Merged

Conversation

BobbieGoede
Copy link
Member

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.

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Feb 21, 2024
@BobbieGoede
Copy link
Member Author

@cpreston321 / @Tahul
Tagging for review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants