Ocelot-Social/webapp/app/router.scrollBehavior.js
roschaefer b9c0749334 fix: scroll to top as default
So nuxt's default scrollBehavior seems to have some kind of "scroll to
anchor" already built in. Unfortunately we cannot use it, because the
the anchor is not yet in the DOM when the scroll behavior is called.

So the justification for this change is:
1. Remove scrollBehavior from `nuxt.config.js` it's deprecated to put it
there.
2. Also *don't* use the default scrollbehavior because of the reasons
above ☝️

Instead I assume to always scroll to the top. This might be undesired
sometimes but let's keep a watchful eye and define the behavior if
needed.
2019-09-29 14:28:38 +02:00

8 lines
159 B
JavaScript

export default function(to, from, savedPosition) {
let position = { x: 0, y: 0 }
if (savedPosition) {
position = savedPosition
}
return position
}