-
Notifications
You must be signed in to change notification settings - Fork 20
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
Update or replace? #34
Comments
It's not possible with current implementation, because Portal is inserted in target using |
There is no need to destroy the component immediatly. I copied the code and added just three lines. I clean all the dom children before appendChild. It works, but does not look clean. Then component leave anyway. Any ideas? |
I have situation when several portals compete for the single target, the last one wins. I have to control it. The example is modals. Opening a new modal removes the previous one |
@AlgoTrader It's possible in Svelte but I guess it's not the intend of a Portal so this feature would be a little off-topic for this component. |
@AlgoTrader it can lead to memory leaks if you just remove all inner elements including svelte rendered components. |
As I said current implementation of svelte-portal do not allow you safely replace target's content. And I do not plan to add this feature in near future, so I will close this issue. |
I have a question, Portal adds new content to some element, but I would like to get replacing. I have a DOM element that can be shared among many
<Portal>
tags.Is it possible that every new Portal render just replaces the content of the DOM element but not just adds there?
The text was updated successfully, but these errors were encountered: