Skip to content

Slot fallback doesn't render when using slot forwarding #5771

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kkarpeev opened this issue Dec 11, 2020 · 4 comments
Closed

Slot fallback doesn't render when using slot forwarding #5771

kkarpeev opened this issue Dec 11, 2020 · 4 comments

Comments

@kkarpeev
Copy link

kkarpeev commented Dec 11, 2020

Svelte 3.31.0

Describe the bug
We have InnerComponent:

  <slot name="a">A fallback</slot>
  <slot name="b">B fallback</slot>
  <slot>Default fallback</slot>

Also we have MyComponent:

<InnerComponent>
  <slot name="a" slot="a"/>
  <slot name="b" slot="b"/>
</InnerComponent>

Then we use it like this:

<MyComponent>
  <div slot="a">Some content</div>
</MyComponent>

And in the InnerComponent we see that the fallback content of slots b and default doesn't render.
Also in the InnerComponent's script:

console.log($$slots);

// { a: true, b: true, default: true }

To Reproduce
Repl

Severity
Annoying. Blocks proper use of slot forwarding for me.

@tanhauhau
Copy link
Member

This is fixed in 3.35.0

@kkarpeev
Copy link
Author

kkarpeev commented Mar 3, 2021

Much thanks! :)

@Valexr
Copy link

Valexr commented Mar 15, 2021

but slot="b" fallback still empty...

@ash0080
Copy link

ash0080 commented May 17, 2021

@tanhauhau
Not work, plz reopen it
#5604

https://svelte.dev/repl/ea168e49b84f46e0ba72391c1f7fb6b2?version=3.38.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants