Skip to content
This repository has been archived by the owner on Feb 26, 2023. It is now read-only.

ifProcessor doesn't work alongside slot prop #475

Open
TheHadiAhmadi opened this issue Sep 13, 2022 · 0 comments
Open

ifProcessor doesn't work alongside slot prop #475

TheHadiAhmadi opened this issue Sep 13, 2022 · 0 comments

Comments

@TheHadiAhmadi
Copy link
Collaborator

TheHadiAhmadi commented Sep 13, 2022

for this code we have error:

<FormDatePicker>
	<div slot="message" if={true}>Hello</div>
</FormDatePicker>
Element with a slot='...' attribute must be a child of a component or a descendant of a custom element

because the processor changes above code to something like this:

<FormDatePicker>
    {#if true}
        <div slot="message">Hello</div>
    {/if}
</FormDatePicker>

and in svelte we cannot have slot prop inside if conditions.

Expected result:

<FormDatePicker>
    <svelte:fragment slot="message">
        {#if true}
            <div>Hello</div>
        {/if}
    </svelte:fragment>
</FormDatePicker>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant