Teleported multi-root child component elements are not being removed together with parent component #3156
Labels
❗ p4-important
Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf.
🐞 bug
Something isn't working
scope: teleport
Version
3.0.5
Reproduction link
https://github.com/Connum/vue-teleport-multiroot-bug
Steps to reproduce
<teleport>
a child component with multiple root elements to somewhere in the bodyWhat is expected?
All traces of the teleported child element are removed
What is actually happening?
The child component's elements remain in the body
Might be related to #1088
I tried looking into this myself, and it seems like there's an issue with the comment nodes - they are removed, but the actual element is not:
and after deletion:
I was able to seemingly fix this for my use case by extending runtime-core/src/renderer.ts like this:
But I also had to check for
child
not being null in theremove()
functions in both NodeOpts.ts files (runtime-tests and runtime-dom), but now 8 tests are failing and I'm a bit stuck because obviously I don't know what I'm doing... 😉The text was updated successfully, but these errors were encountered: