You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an iframe element is reparented the content of the iframe reloads. This makes dealing with iframe elements quite annoying in a dynamic UI. It would be quite nice if a Portal could be reparented without its content reloading.
The text was updated successfully, but these errors were encountered:
This is a thing we've talked about a little (noted here). It doesn't seem particularly hard to me either from a spec or implementation POV; we'd just have to nail down how long you have to reparent before we do throw away the portal contents.
One approach might be something like, as the spec issue says, posting a microtask to discard the contents. This would allow you to reparent as long as you did so synchronously (without yielding to other microtasks or to the event loop).
Would this be good enough, or would we want something that was more powerful than that? (If so, what condition should we use to know that you are actually done with it? The web does not like to use GC as a signal for this sort of thing.)
Ah, thanks. I thought I had seen this somewhere before, but couldn't find it.
I think the microtask approach would work for the cases I'm thinking of where the Portal would move inlining in the flow of a page to moving to a larger viewing area, like a lightbox or starting the transition to activation.
The only other solution I can think of would be to add an explicit preserve function to give you more time to reparent.
When an iframe element is reparented the content of the iframe reloads. This makes dealing with iframe elements quite annoying in a dynamic UI. It would be quite nice if a Portal could be reparented without its content reloading.
The text was updated successfully, but these errors were encountered: