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

Event does not fire when the component is in a browser popup #381

Open
axelmy318 opened this issue Mar 22, 2022 · 6 comments
Open

Event does not fire when the component is in a browser popup #381

axelmy318 opened this issue Mar 22, 2022 · 6 comments

Comments

@axelmy318
Copy link

Hi,

I'm using the window.api() to open a new browser popup in which there is a component with an onClickOustideHandler. However the event does not fire.
The same component works well if I use it in the main browser window.

Do you have a workaround of fix for this ?

@Pomax
Copy link
Owner

Pomax commented Mar 22, 2022

What is window.api()?

@axelmy318
Copy link
Author

Sorry, I meant the window.open() api

@Pomax
Copy link
Owner

Pomax commented Mar 22, 2022

What does the dev tools information for that window tell you? (errors, warnings, etc?)

@axelmy318
Copy link
Author

axelmy318 commented Mar 24, 2022

It doesn't say anything, no warnings, no errors.
I believe it has something to do with the document variable. No matter if the browser popup is focused or not: I think that document always refers to the original page.
I don't know the exact reason for it, but the issue may come from there.

I hope it helps

@marcosalberto
Copy link

Hi @axelmy318,

Did you manage to solve or bypass the issue?

Thank you in advance.

@axelmy318
Copy link
Author

Hey,

I ended up creating a full width full height div in the popup, that is rendered below the element I went to listen for outside click on.
And on this div I simply use a onClick callback...

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