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

Light Dom slots don't trigger disconnectedCallback in synthetic lifecycle #3823

Closed
jmsjtu opened this issue Oct 21, 2023 · 3 comments · Fixed by #3824
Closed

Light Dom slots don't trigger disconnectedCallback in synthetic lifecycle #3823

jmsjtu opened this issue Oct 21, 2023 · 3 comments · Fixed by #3824
Labels

Comments

@jmsjtu
Copy link
Member

jmsjtu commented Oct 21, 2023

Description

Now that light DOM slots use fragments (#3649), they don't trigger disconnectedCallback when ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE is not set.

Steps to Reproduce

Repro:

https://stackblitz.com/edit/salesforce-lwc-fcxo47?file=src%2Fmain.js

In the above example, the disconnectedCallback should be invoked when swapping between the if conditions.

@jmsjtu jmsjtu changed the title Light Dom slots trigger disconnectedCallback Light Dom slots don't trigger disconnectedCallback in synthetic lifecycle Oct 21, 2023
@nolanlawson
Copy link
Collaborator

Does this affect scoped slots as well? And lwc:if/elseif/else? Those all use VFragments as well.

@jmsjtu
Copy link
Member Author

jmsjtu commented Oct 25, 2023

Does this affect scoped slots as well? And lwc:if/elseif/else? Those all use VFragments as well.

@nolanlawson I did some more investigation related to this question and posted a new issue #3827

Working on updating #3824 to bring the light DOM slot behavior back to parity with LWC 3.x.x and opened #3827 to investigate the new bug that's been discovered.

Should have something ready in the morning!

@jmsjtu jmsjtu added the BUG P3 label Oct 25, 2023
@git2gus
Copy link

git2gus bot commented Oct 25, 2023

This issue has been linked to a new work item: W-14361259

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants