Skip to content

Commit c1c518c

Browse files
committed
fix: fix MUI popovers
1 parent 9660a84 commit c1c518c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

site/src/index.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,17 @@
112112
html {
113113
scrollbar-gutter: stable;
114114
}
115+
116+
/*
117+
This is a temporary fix for MUI Modals/Popovers until they are removed.
118+
When html has scrollbar-gutter: stable, the browser reserves space for the scrollbar.
119+
MUI Modals/Popovers, when locking body scroll, add `overflow: hidden` and `padding-right`
120+
to the body to compensate for the scrollbar they are hiding. This added padding-right
121+
conflicts with the already reserved gutter space, causing a layout shift.
122+
This rule overrides MUI's added padding-right on the body specifically when MUI
123+
is likely to have set both overflow:hidden and padding-right.
124+
*/
125+
body[style*="overflow: hidden"][style*="padding-right"] {
126+
padding-right: 0px !important;
127+
}
115128
}

0 commit comments

Comments
 (0)