Which @angular/* package(s) are relevant/related to the feature request?
router, common
Description
Chrome 150 introduced Promise-returning programmatic scroll APIs. These Promises indicate when scrolling has finished and whether it was interrupted.
Angular currently exposes:
scrollToPosition(position: [number, number], options?: ScrollOptions): void;
scrollToAnchor(anchor: string, options?: ScrollOptions): void;
BrowserViewportScroller calls window.scrollTo(), but its return value is discarded.
Proposed solution
Could ViewportScroller expose this completion signal through an additive API, for example:
scrollToPositionAsync(
position: [number, number],
options?: ScrollOptions,
): Promise<ScrollResult>;
scrollToAnchorAsync(
anchor: string,
options?: ScrollOptions,
): Promise<ScrollResult>;
This would allow applications, and potentially the Router in a follow-up, to wait for smooth scrolling to finish and detect interrupted scroll operations.
The existing synchronous methods could remain unchanged for backwards compatibility.
References
Which @angular/* package(s) are relevant/related to the feature request?
router, common
Description
Chrome 150 introduced Promise-returning programmatic scroll APIs. These Promises indicate when scrolling has finished and whether it was interrupted.
Angular currently exposes:
BrowserViewportScrollercallswindow.scrollTo(), but its return value is discarded.Proposed solution
Could
ViewportScrollerexpose this completion signal through an additive API, for example:This would allow applications, and potentially the Router in a follow-up, to wait for smooth scrolling to finish and detect interrupted scroll operations.
The existing synchronous methods could remain unchanged for backwards compatibility.
References