You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ ] 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
Start the playground app.
Navigate to 'Settings'.
Change a value in the form and try to navigate to 'Home'.
Select 'Leave' when the modal appears. Now the user is redirected to the 'Home' page.
Try to close the browser tab.
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:
The text was updated successfully, but these errors were encountered:
I'm submitting a...
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
What is the motivation / use case for changing the behavior?
Environment
The text was updated successfully, but these errors were encountered: