Skip to content

bug: incorrect named slot dom order with serializeShadowRoot: 'scoped' components #6299

Closed

Description

@johnjenkins

Prerequisites

Stencil Version

latest

Current Behavior

A nested component can position / order it's named slots incorrectly in the DOM:

Parent:

       <div>
          <cmp-child>
            <slot name="things" />
            <div class="AFTER">after</div>
          </cmp-child>

          <div>
            <slot />
          </div>
        </div>

Result:

Image

(the 'after' div moves before the slot (and therefore slotted nodes) in the DOM during hydration)

Expected Behavior

The original order of a named <slot /> should be preserved during hydration

System Info

Steps to Reproduce

  • pnpm i
  • pnpm build
  • pnpm express

Code Reproduction URL

https://github.com/johnjenkins/stencil-start-m6opf9rg/tree/incorrect-order-demo

Additional Information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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