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

onUnload function not working properly #130

Open
AdityaKirad opened this issue Aug 31, 2022 · 9 comments
Open

onUnload function not working properly #130

AdityaKirad opened this issue Aug 31, 2022 · 9 comments
Assignees

Comments

@AdityaKirad
Copy link

AdityaKirad commented Aug 31, 2022

the onUnload function triggers as soon as the new window opens up so the problem is that I have this state

const [popup, setPopUp] = useState(false);

and this button

<Button onClick={() => setPopUp(true)}>Login</Button>
{ popup && !session ? (
                <NewWindow url='/SignInPage' onUnload={() => setPopUp(false)} />
              ) : null }

so as I click on the button the state of popup become true and the new window pops up but since the onUnload function triggers before new window unload so the state of popup become false immediately and the popup closes but when I removed onUnload={() => setPopUp(false)} and clicked on the button the new window opens up and the it doesn't closes the onUnload function should triggered after the new window unload

@nmathew98
Copy link
Contributor

@rmariuzzo can i be assigned to this?

@rmariuzzo
Copy link
Owner

Yes

@AdityaKirad
Copy link
Author

Yes

Hey @rmariuzzo can I also join this project

@ilhamgum
Copy link

you could use onLoad method and watch the closed value by interval created by @ilhantekir
#109 (comment)

@rmariuzzo

This comment was marked as resolved.

@rmariuzzo

This comment was marked as resolved.

@rmariuzzo

This comment was marked as resolved.

@rmariuzzo rmariuzzo self-assigned this Nov 26, 2022
@rmariuzzo

This comment was marked as resolved.

@rmariuzzo
Copy link
Owner

@AdityaKirad which browser and React version are you using?

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

4 participants