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

Problem with iframe inside node #177

Open
MaxCheil opened this issue Jan 7, 2022 · 2 comments
Open

Problem with iframe inside node #177

MaxCheil opened this issue Jan 7, 2022 · 2 comments

Comments

@MaxCheil
Copy link

MaxCheil commented Jan 7, 2022

Bug report

  • Package version(s): latest

Steps to reproduce

Get an iframe with url inside all your nodes.
Get 2 panels inside your mosaic.

Actual behavior

When you switch postion between 1 to the second, the panel containing the iframe is reloaded.

Expected behavior

The first node containing also an url is not reloading.
The second node should also not be reloaded.
The second node seems to be created anew after each Dnd switching position with the first one.

Is it possible to not reload the iframa each time for the second node inside the mosaic ? It seems the second node is destroy and re-created each time we make a dnd. It is a weird behavior.

@MaxCheil MaxCheil changed the title If Problem with iframe inside node Jan 7, 2022
@andreas-sqsh
Copy link

andreas-sqsh commented Mar 3, 2022

Hi,

not a bug, but normal React behaviour IMO.

However, this is possible by having a secondary state that keeps a reference to a DOM node within your tile.

Then use a portal that renders your iframe to the DOM node.

https://codesandbox.io/s/2xxw57k82y?file=/src/index.js:720-732

@ggdaltoso
Copy link

Your issue might be related to this StackOverflow answer:

The _Problem:
An iframe contains a completely separate window from the parent window. When a user interacts with an iframe, the parent window no longer receives user events. The browser assumes you want1 to interact with the contents of the iframe, and ignores any draggable attributes that may be on a parent of the iframe.

A Workaround:
You could position an invisible element over the iframe to prevent the user from interacting with the iframe below. Here is an example using an absolute-positioned pseudo-element.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants