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

Opening Modals in the new window #80

Open
sanghaiadarsh opened this issue May 7, 2021 · 9 comments
Open

Opening Modals in the new window #80

sanghaiadarsh opened this issue May 7, 2021 · 9 comments

Comments

@sanghaiadarsh
Copy link

I am facing an issue when working with modal in my components. When the child components (which have been opened in a new child window) have a modal, it opens in the Parent window rather than in the new window itself.

Any idea what might be the solution for this?

@RyanNerd
Copy link
Contributor

react-new-window is using ReactDOM.createPortal().

To get your new window to be the parent of another modal(portal) you may need to use the same technique.

See: https://reactjs.org/docs/portals.html

@pawan-khade
Copy link

I am also facing same issue?
Can you provide actual working example that is solving this problem?

@pawan-khade
Copy link

I have tried using portals but no success.

@rmariuzzo
Copy link
Owner

I would love to help if someone can provide a reproducible scenario with the issue.

@NTCarlos
Copy link

Hello! any luck with this issue? My popups are showing in the parent window, not in the new one. Thanks in advance.

@RyanNerd
Copy link
Contributor

Hello! any luck with this issue? My popups are showing in the parent window, not in the new one. Thanks in advance.

Do you have an example in https://codesandbox.io/ or something similar that shows the issue?

@rmariuzzo
Copy link
Owner

I would love to address this issue. If someone can't provide an example, can someone let me know which library are you using for modals.

@roxieharris
Copy link

Having the same issue and tried to put a Codesandbox together but got the error "Blocked a frame with origin "https://new.csb.app" from accessing a cross-origin frame" when I tried to open the NewWindow. I'm using React Bootstrap modals.

@Mgrdich
Copy link

Mgrdich commented Jul 6, 2023

Hello! any luck with this issue? My popups are showing in the parent window, not in the new one. Thanks in advance.

same here , it has something to do with the ownerDocument, and how React is actually creating reference in the new window

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

No branches or pull requests

7 participants