Skip to content

Bug: scroll behavior is ignored when opening a link for the first time #397

@gaearon

Description

@gaearon

Set scrollBehavior = browser or scrollToTop.

Open page A.
Scroll down.
Click on link to page B.

Expected: window is scrolled to top.
Actual: scroll position has not changed, as if scrollBehavior was none.

The reason for this is this check in ScrollContext:

    if (behavior && position)
      behavior.updateScrollPosition(position, actionType);
  }

It is wrong because even if we don't have a stored position, we must still let behavior handle it.
Behavior might not care about stored position at all — e.g. it might want to just scroll up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions