Skip to content

Why empty $$slots always true? #6947

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
Valexr opened this issue Nov 20, 2021 · 2 comments
Closed

Why empty $$slots always true? #6947

Valexr opened this issue Nov 20, 2021 · 2 comments

Comments

@Valexr
Copy link

Valexr commented Nov 20, 2021

Describe the bug

Empty $$slots always true & rule {#if $$slots.someName} don't usefull

Reproduction

https://svelte.dev/repl/90b44cc9716b460fb6872181b26a559f

Logs

No response

System Info

svelte = latest 

Severity

blocking all usage of svelte

@baseballyama
Copy link
Member

I think This is not a bug but I understood your issue.

Always both italic and bold 's svelte:fragment is rendered in your REPL.
Therefore $$slots.someName should be always true.

I think it's convenient If the below statement is supported.
But now it is not supported.

<H2>
  {#if italic}
    <svelte:fragment slot="italic">
      italic
    </svelte:fragment>
  {/if}
</H2>

@Conduitry
Copy link
Member

Duplicate of #5312.

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

3 participants