Visitar URL original
refactor(docs-infra): use router `scroll: 'manual'` option to skip scrolling by MeAkib · Pull Request #70957 · angular/angular · GitHub
The Wayback Machine - https://web.archive.org/web/20260927121005/https://github.com/angular/angular/pull/70957
Skip to content

refactor(docs-infra): use router scroll: 'manual' option to skip scrolling - #70957

Open
MeAkib wants to merge 1 commit into
angular:mainfrom
MeAkib:docs-infra/router-scroll-manual
Open

MeAkib wants to merge 1 commit into
angular:mainfrom
MeAkib:docs-infra/router-scroll-manual

Conversation

@MeAkib

@MeAkib MeAkib commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

The API reference list updates its query params on every filter change and must not scroll the page when it does. This was done with a custom info: {disableScrolling: true} navigation extra, which AppScroller read back by casting router.lastSuccessfulNavigation()?.extras.info.

The router now supports this directly: NavigationBehaviorOptions#scroll accepts 'manual', and the value is forwarded on the Scroll event as scrollBehavior. Use it instead of the custom flag:

  • ApiReferenceList navigates with scroll: 'manual'.
  • AppScroller filters Scroll events with e.scrollBehavior !== 'manual'.

This removes the untyped info cast, and the flag is now read from the Scroll event of the navigation that emitted it rather than from the last successful navigation.

…rolling

The API reference list updates its query params on every filter change and
must not scroll the page when it does. This was done with a custom
`info: {disableScrolling: true}` navigation extra, which `AppScroller` read
back by casting `router.lastSuccessfulNavigation()?.extras.info`.

The router now supports this directly: `NavigationBehaviorOptions#scroll`
accepts `'manual'`, and the value is forwarded on the `Scroll` event as
`scrollBehavior`. Use it instead of the custom flag:

- `ApiReferenceList` navigates with `scroll: 'manual'`.
- `AppScroller` filters `Scroll` events with `e.scrollBehavior !== 'manual'`.

This removes the untyped `info` cast, and the flag is now read from the
`Scroll` event of the navigation that emitted it rather than from the last
successful navigation.
@pullapprove
pullapprove Bot requested a review from bencodezen September 26, 2026 01:52
@angular-robot angular-robot Bot added the area: docs-infra Angular.dev application and infrastructure label Sep 26, 2026
@ngbot ngbot Bot added this to the Backlog milestone Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: docs-infra Angular.dev application and infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant