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 fallback content shown when rehydrating #2354

Closed
dxlbnl opened this issue Apr 3, 2019 · 3 comments · Fixed by #2409
Closed

Slot fallback content shown when rehydrating #2354

dxlbnl opened this issue Apr 3, 2019 · 3 comments · Fixed by #2409
Labels
Milestone

Comments

@dxlbnl
Copy link
Contributor

dxlbnl commented Apr 3, 2019

The example shows the bug: https://v3.svelte.technology/repl?version=3.0.0-beta.22&example=slot-fallbacks

edit:
So the issue is icw rehydration, where textcontent nodes in a slot are rendered before the content supplied through slot

I'm not sure how to reproduce this in a REPL env.

@athif23
Copy link

athif23 commented Apr 3, 2019

I think it's because you have two <Box> there.

<Box>
	<h2>Hello!</h2>
	<p>This is a box. It can contain anything.</p>
</Box>

<Box/> <--- This is a second Box without content in it, so it should show the fallback, right?

@dxlbnl dxlbnl changed the title Slot fallback content always shown (v3.0.0-beta.22) Slot fallback content shown when rehydrating Apr 3, 2019
@dxlbnl
Copy link
Contributor Author

dxlbnl commented Apr 3, 2019

Yes, you're right, I found that out when trying to find where the "bug" was introduced.
The issue is with sapper, rehydration, and textContent nodes.
So the SSR'ed content is good, but when rehydrating it also renders the fallback content.

@Rich-Harris Rich-Harris added the bug label Apr 6, 2019
@Rich-Harris Rich-Harris added this to the 3.0 milestone Apr 6, 2019
@btakita
Copy link
Contributor

btakita commented Apr 13, 2019

I was able to reproduce the issue at https://github.com/btakita/svelte-slot-default-issue

It's an issue when there is a Text DOM node around or within the slot during rehydration. No Text DOM node, no problem.

See #2394

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants