vueuse / motion

๐Ÿคน Vue Composables putting your components in motion
https://motion.vueuse.org
MIT License
2.13k stars 75 forks source link

fix: prevent preset variants from being mutated #182

Closed BobbieGoede closed 2 months ago

BobbieGoede commented 2 months ago

๐Ÿ”— Linked issue

โ“ Type of change

๐Ÿ“š Description

Resolves #74

This changes the way directive presets are handled, the underlying issue is similar to the one solved in https://github.com/vueuse/motion/pull/173, the preset variants are passed and reused and mutated down the line which is most noticeable in situations such as https://github.com/vueuse/motion/issues/74#issuecomment-1721145546.

To prevent this fix from influencing users variants (I suppose there are use cases where mutating a single motion is desired) I tried to only apply this change to directive presets.

๐Ÿ“ Checklist