fix: web components remount issue #922
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello @Akryum! 👋
This PR fixes the issue that I've hit when using the Web Component as the popover content.
Steps to reproduce:
popper nodeis added to thecontainer--> will callconnectedCallbackon the Web ComponentappendChildcalled -->popper nodeis removed and added to thecontainer--> will calldisconnectedCallbackandconnectedCallbackon the Web ComponentThe thing is that
appendChildmoves the child from its current position to the new one if it was added to thecontainerref and that is exactly what is going on in the third step, and because of it the Web Component is disconnected and connected right away.If the
containeralready contains thatpopper nodethere is no reason to remove and add it again withappendChildcall.Tests passing. I've also verified if it works with the
demo-vue3app.I'll appreciate it if we can merge it as it fixes the big issue for me. Thanks! 🙌