withInMemoryScrolling({ scrollPositionRestoration: 'top' }) not work in standalone api

Discussão em 'Angular' iniciado por Vlad, Dezembro 29, 2024.

  1. Vlad

    Vlad Guest

    When switching to another router, the page appears slightly scrolled. To fix this, I use the withInMemoryScrolling function with the { scrollPositionRestoration: 'top' } parameter. According to the documentation, this should set the scroll position to x = 0, y = 0 on all navigation, but it doesn't work.

    Here is my code below

    bootstrapApplication(AppComponent, {
    providers: [
    provideRouter(appRoutes,
    withInMemoryScrolling({ scrollPositionRestoration: 'top' })),
    ],
    });


    Angular version - 17.1.0

    Continue reading...

Compartilhe esta Página