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(ssr): v-show directive does not work for SSR when value changes before hydration #8371

Closed
wants to merge 2 commits into from

Conversation

kedrzu
Copy link

@kedrzu kedrzu commented May 19, 2023

Let us suppose we have a component with a v-show directive that is wrapped with transition and rendered with SSR.
Initially v-show value is false so in SSR element is rendered with display: none.

Then SSR generated content is hydrated in browser. By the time component gets hydrated value changes from false to true. It may happen for example because the component is asynchronously loaded, or there are minor differences in server and client generated vdom.

What is happening now, is that style display does not get updated upon mounting the component.

Reproduction:
https://codesandbox.io/s/hardcore-hermann-8nst6p?file=/src/App.vue

@edison1105
Copy link
Member

duplicate of #6123 ?

@kedrzu
Copy link
Author

kedrzu commented May 19, 2023

It may be the case.
The condition is transition && value, so it would not correctly update style if:

  • element is initially hidden, transition is not null and value is true (which is my case)
  • element is initially shown and value is false (which is the case in link)

@edison1105
Copy link
Member

Closing as fixed via 98b83e8

@edison1105 edison1105 closed this Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Rejected
Development

Successfully merging this pull request may close these issues.

2 participants