Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

bug: slot content has disconnectedCallback called within dynamic component with and mid-component #6162

Open
3 tasks done
valentinbourqui opened this issue Feb 17, 2025 · 1 comment
Labels
Bug: Validated This PR or Issue is verified to be a bug within Stencil Help Wanted

Comments

@valentinbourqui
Copy link

valentinbourqui commented Feb 17, 2025

Prerequisites

Stencil Version

4.26.0

Current Behavior

Regarding ticket 4284 we have a situation where it's still not working. If you add a stencil component between the dynamic component and your slot all stencil components in the slot will have disconnectedCallback called.

Edit: It looks more general every time there is a tag or something else between the dynamic component and the slot this issue happen

Expected Behavior

Stencil components in slot don't have disconnectedCallback called in the described situation.

System Info

Steps to Reproduce

Create a master stencil component.
Add a dynamic component.
Add inside master stencil component --> dynamic component another component and a slot.
Use master component with another stencil component in the slot.

Activate/deactivate dynamic component

Code Reproduction URL

https://codesandbox.io/p/devbox/broken-conditial-load-forked-g698w7

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Feb 17, 2025
@valentinbourqui valentinbourqui changed the title bug: slot content went unmount within dynamic component with and mid-component bug: slot content has disconnectedCallback called within dynamic component with and mid-component Feb 17, 2025
@johnjenkins
Copy link
Contributor

For whoever tackles this .. my initial notes are this only happens with non shadow: true components.
Probably something to do with the lack of native <slot /> - the slotted content gets removed / re-added.

@christian-bromann christian-bromann added Bug: Validated This PR or Issue is verified to be a bug within Stencil Help Wanted and removed triage labels Feb 18, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Bug: Validated This PR or Issue is verified to be a bug within Stencil Help Wanted
Projects
None yet
Development

No branches or pull requests

3 participants