Skip to content

A component wrapping a custom element is not rendered into a slot correctly #7428

Closed
@winterkind

Description

@winterkind

Describe the bug

See the link to the REPL below...

I have two components, Input and Icon, which both wrap imported custom elements:

  • Icon.svelte is a wrapper for ui5-icon and simply forwards a name attribute.
  • Input.svelte is a wrapper for ui5-input. Input.svelte forwards one named slots of ui5-input: icon.

In my main component, App.svelte, I use Input.svelte twice. Both times I try to set an icon to the input by using the icon slot. When I fill the slot with ui5-icon directly, that works fine. But when I try the same with the Icon.svelte component, no icon shows.

Am I overlooking something obvious or is this a bug? From what I can see in the rendered DOM, one ui5-icon is added as a child of ui5-input in both cases. But in the second case, ui5-icon is missing the slot="icon" attribute.

Reproduction

REPL:
https://svelte.dev/repl/6e8a7f1a4dc64fdba71aa72be8b17be9?version=3.46.6

Logs

No response

System Info

Svelte REPL, version 3.46.6

Severity

annoyance

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