fix(router): Scroll to top delayed to fix transition overlap and reset min-height on App layout
This commit is contained in:
@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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) {
|
||||||
if (savedPosition) {
|
return new Promise((resolve) => {
|
||||||
return savedPosition;
|
setTimeout(() => {
|
||||||
} else {
|
if (savedPosition) {
|
||||||
return { top: 0 };
|
resolve(savedPosition);
|
||||||
}
|
} else {
|
||||||
|
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 ───────────────────────────────────────────
|
||||||
|
|||||||
Reference in New Issue
Block a user