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

fix slot fallback update parent #4598

Merged
merged 3 commits into from
Apr 23, 2020

Conversation

tanhauhau
Copy link
Member

Fixes #4597

@tanhauhau tanhauhau added the slot label Mar 25, 2020
@Conduitry
Copy link
Member

Do you have a changelog-y description of what this fixes? I'm a bit confused about whether what was described in #4597 was just one aspect of a larger problem, or what exactly this changes or fixes, because both the issue and the test involve <svelte:component> but as far as I can tell, the code change does not.

@tanhauhau
Copy link
Member Author

When <svelte:component> tries to get the update_mount_node via get_update_mount_node, the parent is not null, which is wrong. in the repl, the parent is referring to the <div> element which is defined in the main create_fragment function instead of the fallback create_fragment function

@Conduitry
Copy link
Member

This conflicts with #4705 which I merged a little while ago. 4705 changes parent to this and this changes parent to null. I admit I haven't spent too much time thinking about either of these PRs - @tanhauhau and @pushkine do you have any thoughts about why this should be this vs null?

@Conduitry
Copy link
Member

#4703 (the issue said to be fixed by #4705) works on this branch, and #4597 (the issue said to be fixed by this PR) is working on master (which has #4705 already merged in).

@pushkine
Copy link
Contributor

it's the parent of the node, so it should be this
the bug depends on the this.parent && this.parent.is_dom_node() check, both fixes will pass
I'm not familiar enough with slots to say whether changing it to null is safe

@tanhauhau tanhauhau force-pushed the tanhauhau/fix-fallback-parent branch from 5193050 to 92d5df5 Compare April 23, 2020 22:55
@tanhauhau tanhauhau force-pushed the tanhauhau/fix-fallback-parent branch from 92d5df5 to 82b8267 Compare April 23, 2020 22:57
@tanhauhau
Copy link
Member Author

this instead of null is a better fix.

@Conduitry Conduitry merged commit 2bf8fc7 into sveltejs:master Apr 23, 2020
taylorzane pushed a commit to taylorzane/svelte that referenced this pull request Dec 17, 2020
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 this pull request may close these issues.

Slots with dynamic component aren't working
3 participants