diff --git a/webapp/app/router.scrollBehavior.js b/webapp/app/router.scrollBehavior.js index 041310f9c..d34c4c38a 100644 --- a/webapp/app/router.scrollBehavior.js +++ b/webapp/app/router.scrollBehavior.js @@ -1,7 +1,10 @@ export default function(to, from, savedPosition) { - let position = { x: 0, y: 0 } - if (savedPosition) { - position = savedPosition - } - return position + if (savedPosition) return savedPosition + + // Edge case: If you click on a notification from a comment and then on the + // post page you click on 'comments', we avoid a "jumping" scroll behavior, + // ie. jump to the top and scroll back from there + if (to.path === from.path && to.hash !== from.hash) return false + + return { x: 0, y: 0 } }