Skip to content

[split-layout] Child not slotted correctly when vaadin-split-layout contains a slot #567

@Artur-

Description

@Artur-

Description

Use case: A main layout that you render child views inside. The child view is rendered as the primary child of a vaadin-split-layout

@customElement("main-view")
export class MainView extends LitElement {
  render() {
    return html`
        <vaadin-split-layout class="layout" orientation="vertical">
          <slot><slot>
          <div>Something else for the secondary slot</div>
        </vaadin-split-layout>
    `
  }
}

and

<main-view>
   <span>Here is the child</span>
</main-view>

Expected outcome

<slot> is handled as any other element and the end result looks like

<vaadin-split-layout>
   <span>Here is the child</span>
   <div>Something else for the secondary slot</div>
</vaadin-split-layout>

Actual outcome

<vaadin-split-layout orientation="vertical">
  <slot></slot>
  <div slot="primary">code</div>
</vaadin-split-layout>
<span slot="primary">Here is the child</span>

The secondary content is rendered as primary. The primary content is not rendered/slotted at all.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions