-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Closed
Closed
Copy link
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: routerregressionIndicates than the issue relates to something that worked in a previous versionIndicates than the issue relates to something that worked in a previous version
Milestone
Description
Which @angular/* package(s) are the source of the bug?
router
Is this a regression?
Yes
Description
-
There's bug in Angular@>=14.0.5, where
router.eventsdoesn't emitNavigationEndevent if navigation was triggered while other was in progress, in addition to that it won't even update the url with the new value -
This bug happens when trying to do router navigation while other navigation is in progress
-
Happens only if router config has set
initialNavigation: 'enabledBlocking' -
This bug was introduced in Angular@14.0.5 which has only this single MR merged
How to reproduce: (pretty easily)
- Try to do
router.navigate()insidengOnInit()hook in root component (AppComponent)
Minimal reproduction:
- In the console you can see events emitted in following order:
- NavigationStart (first app navigation)
- (RoutesRecognized, GuardsCheckStart, GuardsCheckEnd)
- AppComponent#ngOnInit navigation triggered
- NavigationCancel
- NavigationStart
- (RoutesRecognized, GuardsCheckStart, GuardsCheckEnd)
- On the 7th step I would expect NavigationEnd should be emitted, so I would know that router navigation has been finished, otherwise I'm not able to know that
- In the console you can see events emitted in following order:
- NavigationStart (first app navigation)
- (RoutesRecognized, GuardsCheckStart, GuardsCheckEnd)
- AppComponent#ngOnInit navigation triggered
- NavigationCancel
- NavigationStart
- (RoutesRecognized, GuardsCheckStart, GuardsCheckEnd)
- Navigation End & Scroll
- As you see, in this version it correctly emits NavigationEnd event so I know, that navigation has been finished
Please provide a link to a minimal reproduction of the bug
See in description
Please provide the exception or error you saw
No error/exception is being thrown
Please provide the environment you discovered this bug in (run ng version)
Angular CLI: >= 14.0.5
Node: 18.10.0
Package Manager: npm@8.19.2
OS: Windows 11 64bit
All Angular packages version: >= 14.0.5
Anything else?
- If this change was intended, can anyone suggest, how can I in this case know, when the navigation has been finished?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: routerregressionIndicates than the issue relates to something that worked in a previous versionIndicates than the issue relates to something that worked in a previous version