Open dgibson666 opened 1 month ago
Thanks for the issue! This issue has been labeled as needs reproduction
. This label is added to issues that need a code reproduction.
Please reproduce this issue in an Stencil starter component library and provide a way for us to access it (GitHub repo, StackBlitz, etc). Without a reliable code reproduction, it is unlikely we will be able to resolve the issue, leading to it being closed.
If you have already provided a code snippet and are seeing this message, it is likely that the code snippet was not enough for our team to reproduce the issue.
For a guide on how to create a good reproduction, see our Contributing Guide.
@dgibson666 any updates on the reproduction case?
Prerequisites
Stencil Version
4.22.1
Current Behavior
My understanding is that Stencil will place a
hidden
attribute on a node if it references a named slot that doesn't exist. I know there have been issues around this in the past, so I upgraded Stencil to the very latest and am testing/reporting on v4.22.1. And I am fairly certain you have a bug/regression here.In my case, I have a component whose render lifecycle method renders a named slot within another component. My slotted content is rendering as
hidden
. I believe that this check is flagging the named slot as not existing inside of the nested/rendered component rather than the component in which the named slot is defined and belongs. When I updated my component to not render other components, just plain HTML, this issue went away.I threw a console.log in to be sure the node did not have the
hidden
attribute on it prior to the render lifecycle hook and it was confirmed.I am fairly certain that I've composed components that render other components in the past (with optional named slots) without running into this issue.
Expected Behavior
Do not add
hidden
to the slotted node.System Info
Steps to Reproduce
Case 1 (Original code, rendering slotted content as hidden):
Case 2 (rendering correctly):
Code Reproduction URL
none yet
Additional Information
No response