Repository navigation
Description
Context
Part of #2576.
The page lock under a modal overlay is a root overflow rule: html:has(dialog.bk-overlay[open]:modal) { overflow: hidden; } (packages/ui-kit/src/tokens.css:2357-2358). The dialog itself has no overscroll-behavior (.bk-overlay, tokens.css:2359-2372). Only .bk-overlay-body contains overscroll (tokens.css:2399-2405). A swipe on a scrim, header or short sheet whose body does not overflow can therefore chain to the root. On Android that is where pull-to-refresh starts.
Guide ui-behaviors/prevent-page-scroll-under-modal-dialog: "MANDATORY: Set overscroll-behavior: contain on the <dialog> element itself … and the dialog::backdrop" and "Set overflow: hidden … on dialog::backdrop so that it becomes a scroll container". The guide also says to drop root locks. Containment on non-scrollable containers ships only from Chromium 144 and cannot be feature-detected, and Samsung Internet 30 is Chromium 143, so the root lock stays until Samsung Internet reaches 144.
Scope
- Add
overscroll-behavior: containtodialog.bk-overlay:modal. - Add
overflow: hidden; overscroll-behavior: containto.bk-overlay::backdrop. - Keep the
html:has(…)lock. Next to it, add a comment that names the condition for removing it (Samsung Internet on Chromium ≥144), and cite the guide.
Out of scope
- Removing the root lock.
- Non-modal destination panels (no backdrop).
- Sheet swipe dismissal (D54 addendum), which must keep working.
- Any visual change.
Acceptance criteria
- Computed styles in Chromium show
overscroll-behavior: containon an open modal.bk-overlayand on its::backdrop, andoverflow: hiddenon the backdrop. - A real Chromium test (the pinned browser is ≥144) puts a scrollable page under an open short sheet whose body does not overflow, and overrides the root lock inside the test so it cannot mask the result. A wheel or touch scroll over the sheet header and over the scrim leaves the page's scroll position unchanged. With the new declarations removed, the same test fails. Record that mutation in the PR.
- Sheet swipe dismissal and
.bk-overlay-bodyscrolling behave as before, and overlay visual baselines are unchanged. - Changeset for
@schlessera/brain-ui-kit(patch).
Verification
node scripts/visual.mjs --project=visual --filter=overlay
node scripts/visual.mjs --project=rail-coarse --filter=overlay-stacking
bun run test packages/ui-kit
bun run lintContract impact
- This touches the integration contract, so it needs the
contractlabel, aCONTRACT:commit prefix, and the doc updated in the same commit. - This changes a published package's behaviour, so it needs a changeset.
Only CSS in tokens.css changes.
Activity