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

Can Portals allow reparenting without reload #52

Closed
ericfs opened this issue Jan 25, 2019 · 3 comments
Closed

Can Portals allow reparenting without reload #52

ericfs opened this issue Jan 25, 2019 · 3 comments
Labels
design work needed An acknowledged gap in the proposal that needs design work to resolve

Comments

@ericfs
Copy link

ericfs commented Jan 25, 2019

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.

@jeremyroman
Copy link
Collaborator

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.)

@ericfs
Copy link
Author

ericfs commented Jan 25, 2019

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.

@domenic domenic added the design work needed An acknowledged gap in the proposal that needs design work to resolve label May 8, 2020
@domenic
Copy link
Collaborator

domenic commented May 8, 2020

I'll forward-dupe this to #172 since that has more detailed use cases.

@domenic domenic closed this as completed May 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design work needed An acknowledged gap in the proposal that needs design work to resolve
Projects
None yet
Development

No branches or pull requests

3 participants