antfu/vue-router-better-scroller

Scroll position isn't remembered when going "back" in history

Closed this issue · 0 comments

Describe the bug

Currently the scroll position is only be remembered when navigating "normally" through the page. There is an explicit return to prevent saving the state when using the history back button:
https://github.com/antfu/vue-router-better-scroller/blob/main/src/index.ts#L23

Why is that so?

The problem is that when using the history forward button afterwards the scroll position cannot be restored.

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.