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

Switching between slot children's children that have v-if does not update dom #3569

Open
rashfael opened this issue Apr 8, 2021 · 2 comments · Fixed by #3554
Open

Switching between slot children's children that have v-if does not update dom #3569

rashfael opened this issue Apr 8, 2021 · 2 comments · Fixed by #3554
Labels
🐞 bug Something isn't working 🔩 p2-edge-case

Comments

@rashfael
Copy link

rashfael commented Apr 8, 2021

Version

3.0.11

Reproduction link

https://jsfiddle.net/Lrnebjuv/24/

Steps to reproduce

  • Click button "Click me" multiple times

What is expected?

Text below button should show 1, 2, 3 in a loop

What is actually happening?

Text shows 1, 1, 3 instead


Also happens without .children.default() using <slot></slot> instead in this variant https://jsfiddle.net/Lrnebjuv/25/

Original context is a tab component:
rashfael/buntpapier#22
https://github.com/rashfael/buntpapier/blob/vue3/src/tabs.js

@edison1105
Copy link
Member

edison1105 commented Apr 9, 2021

as a workaround add key to p:

    <Bar>
      <p key="1" v-if="true">
        1
      </p>
    </Bar>
    <Bar>
      <p key="2" v-if="true">
        2
      </p>
    </Bar>

@yyx990803
Copy link
Member

2010607 is a partial fix which does not fix the <slot/> variant

@yyx990803 yyx990803 added 🔩 p2-edge-case and removed 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. labels Jul 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment