Skip to content

Set history.scrollRestoration to manual #7835

@zhouyx

Description

@zhouyx

We set viewport scrollTop to adjust scroll due to size changes. However browser history scroll restoration api can also adjust scroll positions and mess up with our efforts to avoid page jump.

scroll positions are stored and then, more importantly, restored whenever you traverse the history. This often means unsightly jumps as the scroll position changes automatically, and especially so if your app does transitions, or changes the contents of the page in any way. Ultimately this leads to an horrible user experience.

from https://developers.google.com/web/updates/2015/09/history-api-scroll-restoration

As @dvoytenko suggested we can set history.scrollRestoration to manual. However I can't find where we are taking ownership of setting scroll position when traverse history. Is it safe to add history.scrollRestoration = 'manual'?
@dvoytenko

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions