You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compiled using Rollup into dist/main.js then used in a static HTML file:
<!DOCTYPE html><html><head><scriptsrc="dist/main.js"></script></head><body><c-input>
Test label
<spanslot="description">Test</span></c-input></body></html>
Console output: Object { }
You can see in the image below the description slot is missing due to the conditional rendering even though the slot is provided in the usage:
You can create a new Svelte app and utilize the custom element there and you'll get the correct output:
// In SvelteKit: src/routes/index.svelte
<c-input>
Test label
<spanslot="description">Test</span>
</c-input>
Since my organization consumes custom elements in Svelte apps this isn't a huge issue. However, we use raw HTML Storybook to test and document our custom elements so the behavior is not ideal.
The text was updated successfully, but these errors were encountered:
Describe the bug
This has been an issue before: 5594, 6165.
$$slots
is an empty object when using custom elements in plain HTML. Using the custom element in a Svelte app results in the correct behavior.Reproduction
Compiled using Rollup into
dist/main.js
then used in a static HTML file:Console output:
Object { }
You can see in the image below the
description
slot is missing due to the conditional rendering even though the slot is provided in the usage:You can create a new Svelte app and utilize the custom element there and you'll get the correct output:
Console output:
Object { default: true, description: true }
description
slot appears correctly:Finally, here's the Rollup config:
Logs
No response
System Info
Severity
annoyance
Since my organization consumes custom elements in Svelte apps this isn't a huge issue. However, we use raw HTML Storybook to test and document our custom elements so the behavior is not ideal.
The text was updated successfully, but these errors were encountered: