Repository navigation
Conversation
commit: |
Bundle size
PerformanceNo regressions in 36 benchmarks · ran 3m 52s · details Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
I reproduced the 16px layout shift with classic body scrollbars. I now preserve the body gutter only when it has an inset scrollbar and restore its previous gutter on unlock; overlay-scrollbar layouts retain their original width. I added a browser regression with overflowing content and a nonzero body scroll position, checking width and position through lock and unlock. Disabling the gutter preservation makes the width assertion fail. 🤖 Comment posted by Codex |
PR reviewNothing here blocks merge. The fixes from earlier rounds are in place in the current code: the body gutter is preserved and restored, the body is only treated as the page scroller when it actually overflows vertically, and body measurements only happen when the body is the element being locked. Two small issues remain. The new gutter regression test probably can't fail in CI's default headless Chromium. And a body-scroller page whose content is short when the dialog opens never gets locked. I only read the code; I didn't run any tests or reproduce anything in a browser. Bugs (1)1. 🟡 Body-scroller pages that grow after a dialog opens are never lockedLocation: const htmlClipsViewport = /hidden|clip/.test(ownerWindow(html).getComputedStyle(html).overflowY);
const bodyScrolls =
htmlClipsViewport && isOverflowElement(body) && body.scrollHeight > body.clientHeight;
return bodyScrolls ? body : html;Take the layout this PR targets: The base version behaved the same way, so this isn't a regression. But the new Failure scenario: An app uses the html-clip/body-scroll layout and shows a short loading skeleton. A modal dialog opens, then data arrives and the body starts overflowing. The page behind the modal scrolls with the wheel or touch. Fix: When Tests (1)1. 🟡 The gutter-preservation regression test can pass without the fix in CILocation: expect(document.body.scrollHeight).toBeGreaterThan(document.body.clientHeight);
document.body.scrollTop = 100;
expect(document.body.scrollTop).toBe(100);
const contentWidth = document.body.clientWidth;The width assertion only means something when the body draws a classic scrollbar that takes up space. The browser config ( Failure scenario: Someone removes or breaks the Fix: Before locking, assert the precondition VerdictApprove after nits - the remaining items are a narrow late-overflow gap and a regression test that CI's default headless setup may not exercise; there are no blocking regressions. 🤖 Review generated with Claude Code |
|
I reproduced the premature handoff with I also moved the body gutter measurements inside the body-lock branch. The earlier style-only test is covered by the overflowing-body regression, which checks width and scroll position through lock and unlock. 🤖 Comment posted by Codex |
|
I’m not sure if this is something we should fix. I’m wondering if there is a way we can provide an API or a workaround for people to handle this themselves. It seems a bit of an edge-case. |
Fixes #5720
!importantrules on body overflow still override the lock. BrowserStack scenarios ran in Chrome on Windows; Firefox and Safari were not tested.