mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
refactor(router): add comment about scroll/focus
Add consideration for future behavior in the completion of the navigation event.
This commit is contained in:
committed by
Pawel Kozlowski
parent
cc03254b12
commit
fd65dc5d53
@@ -169,6 +169,10 @@ export class NavigationStateManager extends StateManager {
|
||||
removeAbortListener?.();
|
||||
// Update `activeHistoryEntry` to the new current entry from Navigation API.
|
||||
this.activeHistoryEntry = this.navigation.currentEntry!;
|
||||
// TODO(atscott): Consider initiating scroll here since it will be attempted periodically.
|
||||
// We have to wait for render to resolve because focus reset is only done once in the spec.
|
||||
// Render is not synchronous with NavigationEnd today. The Router's navigation promise resolve
|
||||
// is what _causes_ the render to happen with ZoneJS...
|
||||
// Resolve handler after next render to defer scroll and focus reset.
|
||||
afterNextRender({read: () => resolveHandler?.()}, {injector: this.injector});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user