Skip to content

Commit c7a901c

Browse files
committed
Fix scroll behavior and improve overflow handling in router transitions
1 parent 82970cf commit c7a901c

File tree

10 files changed

+16
-12
lines changed

10 files changed

+16
-12
lines changed

public/css/theme.css

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,15 @@ body {
140140
#app {
141141
min-height: 100vh;
142142
position: relative;
143-
overflow: hidden;
143+
overflow: visible;
144144
width: 100%;
145-
height: 100%;
145+
height: auto;
146146
display: block;
147147
}
148148

149-
/* Ensure the app container takes full height */
150-
html, body, #app {
151-
height: 100%;
149+
/* Ensure the app container takes full height but allows scrolling */
150+
html, body {
151+
min-height: 100%;
152152
margin: 0;
153153
padding: 0;
154154
}

public/icons/favicon.dark.ico

148 Bytes
Binary file not shown.

public/icons/favicon.dark.png

-2.96 KB
Loading

public/icons/favicon.dark.svg

Lines changed: 1 addition & 1 deletion
Loading

public/icons/favicon.light.ico

-148 Bytes
Binary file not shown.

public/icons/favicon.light.png

2.96 KB
Loading

public/icons/favicon.light.svg

Lines changed: 1 addition & 1 deletion
Loading

public/icons/logo.dark.svg

Lines changed: 1 addition & 1 deletion
Loading

public/icons/logo.light.svg

Lines changed: 1 addition & 1 deletion
Loading

public/js/router.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ class Router {
145145
// Add the overlay to the body
146146
document.body.appendChild(transitionOverlay);
147147

148-
// Prevent scrolling during transition
149-
document.body.style.overflow = 'hidden';
148+
// We no longer need to prevent scrolling during transition
149+
// document.body.style.overflow = 'hidden';
150150

151151
// Fade in the overlay
152152
setTimeout(() => {
@@ -217,6 +217,7 @@ class Router {
217217
// Remove the overlay after the transition completes
218218
setTimeout(() => {
219219
document.body.removeChild(transitionOverlay);
220+
// Ensure overflow is always reset
220221
document.body.style.overflow = '';
221222
}, 150); // Match the transition duration
222223
} else {
@@ -232,6 +233,7 @@ class Router {
232233
// Remove the overlay after the transition completes
233234
setTimeout(() => {
234235
document.body.removeChild(transitionOverlay);
236+
// Ensure overflow is always reset
235237
document.body.style.overflow = '';
236238
}, 150); // Match the transition duration
237239
}
@@ -244,8 +246,10 @@ class Router {
244246
// Remove the overlay
245247
if (document.querySelector('.transition-overlay')) {
246248
document.body.removeChild(document.querySelector('.transition-overlay'));
247-
document.body.style.overflow = '';
248249
}
250+
251+
// Always ensure overflow is reset, even in error cases
252+
document.body.style.overflow = '';
249253
} finally {
250254
// Clear loading state
251255
this.loading = false;

0 commit comments

Comments
 (0)