-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Slot forwarding doesn't work as it were #8765
Comments
I'm honestly not sure what the more correct behavior is - arguably that slot is taken, by the component passing things through, so you could make the argument that the one passing through now should take care of the fallback. |
@dummdidumm It is slot forwarding (not a nesting) that worked in specific way from the start until .29 in the same Svelte 3. Breaking changes in slot behavior are clearly not correct. Not to mention it breaks composition. |
This comment was marked as duplicate.
This comment was marked as duplicate.
I just tried it using a fragment instead and that seems to work so it seems to be an inconsistent behavior at least? @kkarpeev Maybe this works as a workaround for you? https://svelte.dev/repl/6c5c247ba9eb4cd8941d72cc57376a35?version=3.59.1 |
@hjalmar The way I see it, your example does one forward (using the As I understand the issue, it's specifically that forwarding currently breaks any The second use of #2079 may also be relevant. |
well, in https://svelte.dev/repl/2cdf3c12fda14ff980bcc8426179dd4f?version=3.28.0 you would not be able to pass content from the problem that you are pointing out is that <Component2>
{#if $$slots['1']}
<slot name="1" slot="2" />
{/if}
</Component2> though the conditional slot is currently undecided as the team is still settling down what would be for svelte 5 |
No, this doesn't work for a default slot. It just ignores upd: and what's undecided about svelte 3 (I'm using 3, not 5)? It's it your docs |
Nope, it's not a workaround for a default slot either. |
Can you, please, make this work in any way, please? |
Describe the bug
Slot forwarding doesn't work as it were in 3.28. When middle component merely forwards named (or even default) slot, deeper component thinks that this slot is occupied. But it's not.
Reproduction
Correct behavior
Broken in 3.29
Logs
No response
System Info
Severity
blocking an upgrade
The text was updated successfully, but these errors were encountered: