Teleported content is duplicated if a text interpolated value is updated and v-ifed in and out of the DOM
Version
3.2.21
Reproduction link
Steps to reproduce
- Click the button labeled 'Toggle'
- Click the button labeled 'Update'
- Click the button labeled 'Toggle'
- Click the button labeled 'Toggle'
- Click the button labeled 'Update'
- Click the button labeled 'Toggle'
- Click the button labeled 'Toggle'
Notice that the teleported text is duplicated. Repeating the steps above will append the content with more duplicated text.
What is expected?
Teleported content can be shown and hidden without duplication
What is actually happening?
Teleported content is duplicated
I was attempting to use teleport to create a modal and found that teleported content was being duplicated as I was routing throughout the application, although routing is not required to reproduce the issue as demonstrated in the minimal reproduction link.
as a workaround
<teleport to="body">
<span key="1">
This text is teleported and will be duplicated.
</span>
</teleport>
maybe should force bail out of optimize mode
I have a similar Issue. @mmrpm the repro you provided doesn't work anymore (throws Errors) @edison1105 This is a workaround inside of vuejs core, correct? => not a workaround that one can use in a normal Vue Project, correct?