Skip to content

bug: ssr. Scoped component w/ forwarded named slot; slotted elements missing #6339

@johnjenkins

Description

@johnjenkins

Prerequisites

Stencil Version

latest

Current Behavior

  1. define a scoped: true component with a named slot, forwarded to a shadow: true component:
  // parent-scoped.tsx
   <div>
          Scoped parent with named slot.
          <shadow-child-1>
            <slot name="things" />
          </shadow-child-1>         
        </div>
  1. forward the shadow-dom enabled component's <slot /> to another shadow: true component:
// child-shadow-1.tsx
        <div>
          <shadow-child-2>
            <slot />
          </shadow-child-2>
        </div>

The slotted nodes are not visible (although the slot's comment-placeholder is there), they are 'left-behind', nested within the child's shadow-dom.

Image

Expected Behavior

Named slotted nodes should be forwarded appropriately and be visible

System Info

Steps to Reproduce

pnpm i
pnpm build
pnpm express

Navigate to /slot-forwarding-named-slot

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