Skip to content

Commit fbc66a8

Browse files
committed
Fixing a layout shifting issue with scrollbars
1 parent 06ba20b commit fbc66a8

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/components/YvSidebar/YvSidebar.vue

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ function handleScroll() {
4343
bg="light-100 dark:dark-900"
4444
border="l neutral-200 dark:neutral-800"
4545
flex flex-col
46+
class="sidebar-drawer"
4647
>
4748
<motion.div
4849
v-if="fm.isDrawerOpen"
@@ -74,6 +75,7 @@ function handleScroll() {
7475
flex="~ grow-1"
7576
overflow-auto
7677
h-full pt-4
78+
class="sidebar-scroll-container"
7779
@scroll="handleScroll"
7880
>
7981
<ul v-bind="wrapperProps" mb-8>
@@ -100,14 +102,30 @@ function handleScroll() {
100102
display: grid;
101103
grid-template-columns: 1fr auto;
102104
height: calc(var(--vh) - var(--nav-height) - var(--footer-height)) !important;
105+
/* Ensure consistent layout regardless of scrollbar visibility */
106+
overflow: hidden;
103107
}
104108
105109
.main-content {
106110
overflow: hidden;
107111
min-width: 0;
112+
/* Force scrollbar space to always be reserved */
113+
scrollbar-gutter: stable;
114+
}
115+
116+
.sidebar-drawer {
117+
/* Ensure the sidebar doesn't affect main content layout */
118+
flex-shrink: 0;
119+
overflow: hidden;
108120
}
109121
110122
.sidebar-content {
111123
height: calc(var(--vh) - var(--nav-height) - 70px - var(--footer-height)) !important;
124+
overflow: hidden;
125+
}
126+
127+
.sidebar-scroll-container {
128+
/* Force consistent scrollbar behavior */
129+
scrollbar-gutter: stable;
112130
}
113131
</style>

0 commit comments

Comments
 (0)