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

Browser beforeunload subscription leak #8

Closed
serlopez46 opened this issue Jan 14, 2021 · 1 comment
Closed

Browser beforeunload subscription leak #8

serlopez46 opened this issue Jan 14, 2021 · 1 comment

Comments

@serlopez46
Copy link

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

The subscription to the browser's beforeunload event does not seem to be unsubscribed after the user navigates outside the page, opening the modal when closing the browser's tab even when the user is not in the page that has the guard.

Expected behavior

The modal should not appear if the user is not even in the page that has the guard.

Minimal reproduction of the problem with instructions

  1. Start the playground app.
  2. Navigate to 'Settings'.
  3. Change a value in the form and try to navigate to 'Home'.
  4. Select 'Leave' when the modal appears. Now the user is redirected to the 'Home' page.
  5. Try to close the browser tab.
  6. A modal appears telling the user some changes were not saved.

What is the motivation / use case for changing the behavior?

Environment


Angular version: 9.1.0


Browser:
- [x] Chrome (desktop) version 87
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: 12.18.0  
- Platform:  Windows 

Others:

@NetanelBasal
Copy link
Member

@danzrou, can you please check it?

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

2 participants