Skip to content

Commit b2c8508

Browse files
markgohoclaude
andcommitted
fix: scroll to top on route navigation
Add withInMemoryScrolling({ scrollPositionRestoration: 'top' }) to the router config so the page scrolls to top when navigating between routes, fixing the wizard steps not scrolling back up. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9fd5e29 commit b2c8508

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

members/src/app/app.config.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
import { initializeApp, provideFirebaseApp } from '@angular/fire/app';
99
import { connectAuthEmulator, getAuth, provideAuth } from '@angular/fire/auth';
1010
import { connectFirestoreEmulator, getFirestore, provideFirestore } from '@angular/fire/firestore';
11-
import { provideRouter, withComponentInputBinding } from '@angular/router';
11+
import { provideRouter, withComponentInputBinding, withInMemoryScrolling } from '@angular/router';
1212
import { routes } from './app.routes';
1313
import { authInterceptor } from './interceptors/auth.interceptor';
1414
import { windowProvider } from './services/window.token';
@@ -22,7 +22,11 @@ export const appConfig: ApplicationConfig = {
2222
provideBrowserGlobalErrorListeners(),
2323
provideZonelessChangeDetection(),
2424
provideHttpClient(withFetch(), withInterceptors([authInterceptor])),
25-
provideRouter(routes, withComponentInputBinding()),
25+
provideRouter(
26+
routes,
27+
withComponentInputBinding(),
28+
withInMemoryScrolling({ scrollPositionRestoration: 'top' }),
29+
),
2630
// Firebase providers
2731
provideFirebaseApp(() =>
2832
initializeApp({

0 commit comments

Comments
 (0)