Skip to content
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 containing only {@html value} renders in wrong place on update #5012

Closed
dimfeld opened this issue Jun 13, 2020 · 1 comment · Fixed by #5061
Closed

Slot containing only {@html value} renders in wrong place on update #5012

dimfeld opened this issue Jun 13, 2020 · 1 comment · Fixed by #5061

Comments

@dimfeld
Copy link
Contributor

dimfeld commented Jun 13, 2020

Describe the bug
When a slotted component is instantiated and the only contents of the slot is {@html value}, changing value will cause the HTML-ized value to render at the end of the slot's parent element (i.e. after all sibling elements) instead of in the correct place.

To Reproduce
https://svelte.dev/repl/1f9da40bca4b44a089041e826648de2f

Click the Switch button and see that the contents of the slot moves to the end.

Expected behavior
Slot continues to render in the correct place.

Information about your Svelte project:
Looks like this appeared in version 3.7 and is still present in 3.23.2. If I run the REPL on 3.6.11 it behaves properly.

Severity

Potentially serious, but not serious for me.

Can be worked around by changing the slot contents to <div>{@html value}</div> or changing the child component to use <div><slot /><div>, which works fine for me.

@Conduitry
Copy link
Member

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

Successfully merging a pull request may close this issue.

2 participants