You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: slot element loses its parent reference and disappears when its parent is rendered conditionally #3913
I have searched for existing issues that already report this problem, without success.
Stencil Version
2.13.0
Current Behavior
When I try to render the default slot within the conditionally rendered parent element in the no-shadow component and the parent element is changed, the slot relocation algorithm loses the parent element reference and the slot element is not relocated (re-rendered) into the new parent element.
Expected Behavior
Slot element should be relocated to the new parent element.
System Info
No response
Steps to Reproduce
In the reproduction project:
you will see the typography element is rendered correctly and the slot will be displayed within the "span" element in the "app-typography" component DOM structure
when the user clicks on the "Toggle Element type" button, the handler function finds the typography element and changes its "element" attribute (which controls the rendered element tag of the slot's parent)
then you will see the "span" element turns to the "p" element within the "app-typography" component DOM structure and the slot disappears (not relocated)
However, do you expect that this PR is gonna be merged soon? I see it is open since June 2021 😞 Do you think I can do anything to speed up this process?
Hey there 👋 we have released a Stencil version v4.8.2 with a fix for this issue. Make sure you enable it with the experimentalSlotFixes flag in your Stencil configuration. Let us know if you have any further question. Thanks for reporting!
Activity
johnjenkins commentedon Dec 15, 2022
just tested - this bug will be fixed by this pr
yigityuce commentedon Dec 15, 2022
thanks for your quick response!
However, do you expect that this PR is gonna be merged soon? I see it is open since June 2021 😞 Do you think I can do anything to speed up this process?
rwaskiewicz commentedon Dec 15, 2022
Hey all,
We're going to be working on slot-related fixes following the Stencil v3 release, which is slated to occur in January. Thanks!
rwaskiewicz commentedon Jul 24, 2023
Potentially related #4284
fix(runtime): re-relocate slot if parent element's tagname changes
fix(runtime): re-relocate slot if parent element's tagname changes
fix(runtime): relocate slotted content when slot parent element tag c…
fix(runtime): hide slotted content with no destination in scoped comp…
christian-bromann commentedon Dec 11, 2023
Hey there 👋 we have released a Stencil version
v4.8.2with a fix for this issue. Make sure you enable it with theexperimentalSlotFixesflag in your Stencil configuration. Let us know if you have any further question. Thanks for reporting!