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(component): preserve variant style on rerender #203

Merged
merged 4 commits into from
Jun 22, 2024

Conversation

ZhouY11
Copy link
Contributor

@ZhouY11 ZhouY11 commented Jun 18, 2024

πŸ”— Linked issue

Issue #202

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme or JSDoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have added tests (if possible).
  • I have updated the documentation accordingly.

@Tahul Tahul requested a review from BobbieGoede June 18, 2024 16:53
@Tahul
Copy link
Member

Tahul commented Jun 18, 2024

Hey @BobbieGoede ; could you also confirm this is proper solution?

It looks good to me but I've not been playing with vnodes for a while πŸ˜„

@BobbieGoede
Copy link
Member

Thanks for contributing! I'll give it a closer look soon and test with your reproduction from #202, we may be able to use the set function on the motion instance to reapply the correct styles.

Sorry for the delay, I just got back from a holiday πŸ˜…

@BobbieGoede BobbieGoede force-pushed the fix/component-updated-styles branch from 46a5563 to 3dc48d2 Compare June 22, 2024 11:16
@BobbieGoede
Copy link
Member

I've added a basic regression test so we know this keeps working in the future.

Whether this is the proper solution for the issue I'm not sure, I tried some other approaches which didn't pan out and this works well as is πŸ˜„ There isn't much documentation on vnodes and their lifecycle functions, I'll make sure to revisit and review in the future as I learn more πŸ’ͺ

Thanks again for contributing!

@BobbieGoede BobbieGoede changed the title fix: Motion component applied expired styles after component updated fix(component): preserve variant style on rerender Jun 22, 2024
@BobbieGoede BobbieGoede merged commit 94ef364 into vueuse:main Jun 22, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants