Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitce4c8c7

Browse files
authored
fix: prevent layout shift when Select component dropdown appears (#17990)
When scrollbars are always visible, open the dropdown for a `Select`component causes a layout shift because of scrollbars being hidden whenthe` Select` is open. This fix prevents the layout shift from thescrollbar being removed.https://github.com/user-attachments/assets/6b0aff70-c585-401b-911d-f0805b54903e
1 parente8306cc commitce4c8c7

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)

[8]ページ先頭

©2009-2025 Movatter.jp