From 0e43ce70d166b438de2a7f4296fbc9982eb81933 Mon Sep 17 00:00:00 2001 From: Hanzo_dev <2002samudiojohan@gmail.com> Date: Thu, 12 Mar 2026 14:03:25 -0500 Subject: [PATCH] fix(router): Scroll to top delayed to fix transition overlap and reset min-height on App layout --- frontend/src/App.vue | 4 ++-- frontend/src/router/index.ts | 14 +++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 0511b83..616c2d2 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -249,7 +249,7 @@ body { margin: 0; padding: 0; width: 100%; - height: 100%; + min-height: 100vh; overflow-x: hidden; background-color: var(--bg-primary); color: var(--text-primary); @@ -264,7 +264,7 @@ body { #app { width: 100%; - height: 100vh; + min-height: 100vh; display: flex; flex-direction: column; } diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts index e2f9859..2081b96 100644 --- a/frontend/src/router/index.ts +++ b/frontend/src/router/index.ts @@ -6,11 +6,15 @@ import { useAuthStore } from '@/stores/auth' const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), scrollBehavior(_to, _from, savedPosition) { - if (savedPosition) { - return savedPosition; - } else { - return { top: 0 }; - } + return new Promise((resolve) => { + setTimeout(() => { + if (savedPosition) { + resolve(savedPosition); + } else { + resolve({ top: 0, left: 0, behavior: 'smooth' }); + } + }, 300); // Wait for the page transition to finish (0.3s) + }); }, routes: [ // ─── Vistas Públicas Core ───────────────────────────────────────────