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-show): v-show takes higher priority than style attribute #3230

Merged
merged 3 commits into from
Feb 25, 2021
Merged

fix(v-show): v-show takes higher priority than style attribute #3230

merged 3 commits into from
Feb 25, 2021

Conversation

HcySunYang
Copy link
Member

Fix: #2757

This PR is also re-fixed #2583, even though this commit can fix issue #2583, but it causes issue #2757.

@HcySunYang
Copy link
Member Author

Another way to deal with the problem is that we parse the string type style into an object, but I think this has two shortcomings:

  1. This eats up performance
  2. The original intention has been changed, using cssText is still the correct way.

// so we always keep the current `display` value regardless of the `style` value,
// thus handing over control to `v-show`.
if ('_vod' in el) {
style.display = current
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think this will trigger a reflow? https://csstriggers.com/display

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is ok, because v-show always sets the display property no matter what it is here 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants