fix(router): Scroll to top delayed to fix transition overlap and reset min-height on App layout

This commit is contained in:
2026-03-12 14:03:25 -05:00
parent 1d3f0ce2fa
commit 0e43ce70d1
2 changed files with 11 additions and 7 deletions

View File

@ -249,7 +249,7 @@ body {
margin: 0; margin: 0;
padding: 0; padding: 0;
width: 100%; width: 100%;
height: 100%; min-height: 100vh;
overflow-x: hidden; overflow-x: hidden;
background-color: var(--bg-primary); background-color: var(--bg-primary);
color: var(--text-primary); color: var(--text-primary);
@ -264,7 +264,7 @@ body {
#app { #app {
width: 100%; width: 100%;
height: 100vh; min-height: 100vh;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }

View File

@ -6,11 +6,15 @@ import { useAuthStore } from '@/stores/auth'
const router = createRouter({ const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL), history: createWebHistory(import.meta.env.BASE_URL),
scrollBehavior(_to, _from, savedPosition) { scrollBehavior(_to, _from, savedPosition) {
return new Promise((resolve) => {
setTimeout(() => {
if (savedPosition) { if (savedPosition) {
return savedPosition; resolve(savedPosition);
} else { } else {
return { top: 0 }; resolve({ top: 0, left: 0, behavior: 'smooth' });
} }
}, 300); // Wait for the page transition to finish (0.3s)
});
}, },
routes: [ routes: [
// ─── Vistas Públicas Core ─────────────────────────────────────────── // ─── Vistas Públicas Core ───────────────────────────────────────────