romkor / svelte-portal

Svelte component for rendering outside the DOM of parent component
https://svelte.dev/repl/407576d4fa984cfb97dcdd3da98e833e
MIT License
444 stars 22 forks source link

remove element directly from target #50

Closed lukasIO closed 3 years ago

lukasIO commented 3 years ago

Hi,

for me the content of the portal never got actually removed because the parent was always undefined. This approach seems to fix it.

romkor commented 3 years ago

Hi @lukasIO! Can you share some example on https://svelte.dev/repl?

lukasIO commented 3 years ago

Hi @romkor,

should have specified the scenario a bit, sorry. It happens for me when using sapper and the portal target is part of a _layout route while the portal is being called from a "regular" component.

I'll see if I can spin up a minimal repro repo.

romkor commented 3 years ago

Please create issue with detailed description what is broken. And create reproducible example on https://svelte.dev/repl. I will close this pull request.