Skip to content

bug: ssr, scoped parent incorrectly 'steals' nested shadow-dom <slot />s #6337

@johnjenkins

Description

@johnjenkins

Prerequisites

Stencil Version

latest

Current Behavior

  1. Setup a scoped component which forwards it's slot to a shadow component
 // scoped-parent.tsx
       <div>
          Scoped parent.
          <shadow-child-1>
            <slot />
          </shadow-child-1>         
        </div>
  1. The child component forwards it's slot to another shadow component
 // shadow-child-1.tsx
       <div>
          <shadow-child-2>
            <slot />
          </shadow-child-2>
        </div>

The scoped parent will 'steal' it's child component's <slot /> element (or rather - not add the slot element to the child's shadowRoot) resulting in none of the slotted content rendering.

Image

Expected Behavior

scoped components should not take ownership of nested shadow components slot elements. Slotted content should render.

System Info

Steps to Reproduce

pnpm i
pnpm build
pnpm express

Code Reproduction URL

https://github.com/johnjenkins/stencil-start-m6opf9rg/

Additional Information

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions