scrollBehavior is not what I expected
mofiter opened this issue · comments
Kevin Wisoky commented
Versions
- nuxt: v2.15.8
- node: v14.18.1
Reproduction
scrollBehavior is not what I expected, here is the codesanbox link
Additional Details
I created app/router.scrollBehavior.js file to define a custom behavior
Steps to reproduce
- open the
pages/index.vue
, scroll it down, the picture below is an example:
- click item, it will enter
pages/product/_id.vue
, the picture below is an example:
- click browser's back button, back to
pages/index.vue
.
What is Expected?
- from
pages/index.vue
topages/product/_id.vue
, I don't expect it scroll to top inpages/index.vue
at first; - from
pages/product/_id.vue
back topages/index.vue
, I expect it scroll to savedPosition.
What is actually happening?
- from
pages/index.vue
topages/product/_id.vue
, it scroll to top inpages/index.vue
at first; - from
pages/product/_id.vue
back topages/index.vue
, it scroll to top. - the gif below is an example:
stale commented
Thanks for your contribution to Nuxt!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:
- Verify that you can still reproduce the issue in the latest version of nuxt-edge
- Comment the steps to reproduce it
Issues that are labeled as pending
will not be automatically marked as stale.