From 661ea6c0227bdb8b726839602e040ac4fdce9b7a Mon Sep 17 00:00:00 2001 From: Bernhard Kirchen Date: Mon, 28 Oct 2024 21:11:07 +0100 Subject: [PATCH] webapp: always scroll up when navigating to another view --- webapp/src/router/index.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/webapp/src/router/index.ts b/webapp/src/router/index.ts index 0b35e2b6..cd3bdbec 100644 --- a/webapp/src/router/index.ts +++ b/webapp/src/router/index.ts @@ -23,6 +23,13 @@ import { createRouter, createWebHistory } from 'vue-router'; const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), linkActiveClass: 'active', + scrollBehavior() { + return new Promise((resolve) => { + setTimeout(() => { + resolve({ top: 0 }); + }, 100); + }); + }, routes: [ { path: '/',