From 56d7008668768f5070519ff79bc0d04deb2204d2 Mon Sep 17 00:00:00 2001 From: Jaayden Halko Date: Thu, 22 May 2025 19:49:02 +0000 Subject: [PATCH] fix: fix MUI popovers --- site/src/index.css | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/site/src/index.css b/site/src/index.css index 36f1c62954614..04b388a5cba99 100644 --- a/site/src/index.css +++ b/site/src/index.css @@ -112,4 +112,17 @@ html { scrollbar-gutter: stable; } + + /* + This is a temporary fix for MUI Modals/Popovers until they are removed. + When html has scrollbar-gutter: stable, the browser reserves space for the scrollbar. + MUI Modals/Popovers, when locking body scroll, add `overflow: hidden` and `padding-right` + to the body to compensate for the scrollbar they are hiding. This added padding-right + conflicts with the already reserved gutter space, causing a layout shift. + This rule overrides MUI's added padding-right on the body specifically when MUI + is likely to have set both overflow:hidden and padding-right. + */ + body[style*="overflow: hidden"][style*="padding-right"] { + padding-right: 0px !important; + } }