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

iFrame widget content reloads when changing views #731

Closed
rafaellehmkuhl opened this issue Feb 9, 2024 · 2 comments · Fixed by #1022
Closed

iFrame widget content reloads when changing views #731

rafaellehmkuhl opened this issue Feb 9, 2024 · 2 comments · Fixed by #1022
Assignees
Labels
bug Something isn't working ux Has to do with the user experience

Comments

@rafaellehmkuhl
Copy link
Member

Reported by @rjehangir:

It would be cool if the iframe could maintain a session even if you change the view and come back. Right now it reloads the page every time.

@rafaellehmkuhl rafaellehmkuhl added bug Something isn't working ux Has to do with the user experience labels Feb 9, 2024
@rafaellehmkuhl rafaellehmkuhl added this to the FromBetaToStable milestone Feb 9, 2024
@JoaoMario109
Copy link
Contributor

The issue with the iFrame reloading, even though the component is not "unmounted" in Vue, is probably related to how widgets are rendered on the screen in this code.
This results in the widget being either removed or moved in the real browser DOM. According to information in these links:

So it seems that it is impossible to move or remove an iFrame in the real browser DOM without it being freed and recreated, causing the unwanted reload. A simple test for this is to set all lifecycle hooks in Vue and print debug messages for these events. Use a YouTube video in an iFrame, and when switching views, observe that the hooks are not called, but the video stops and reloads when returning to the original view containing the iFrame. This implies that the iFrame is being removed and freed under the hood in the real browser DOM.

So to address this we will likely need to handle iFrame widgets specially by ensuring they reside in a separate parent element that never removes or moves them, and we just control their visibility and positions.

@rafaellehmkuhl
Copy link
Member Author

More on that on the whatwg repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ux Has to do with the user experience
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants