Repository navigation
console: pin the page behind an open dialog so iOS can't scroll a drawer away - #463
Merged
Merged
Conversation
drudge
commented
Oct 19, 2026
drudge
left a comment
Owner
Author
There was a problem hiding this comment.
Review by Blake, posted by Whiteface: APPROVE.
Body is pinned fixed at -scrollY via a root class driven by the existing dialog[open] MutationObserver and restored on close; header auto-hide is guarded; regression script extended and Browser regression CI green.
Non-blocking: inset-inline: 0 means horizontal scroll isn't pinned (only matters under 320px viewports).
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Nick · project thread
Before: on an iPhone (seen in the Home Screen app), an Insights device drawer could end up floating partway up the screen, its top cut off, with the finding rows showing undimmed below its footer.
After: the drawer stays anchored to the bottom of the screen with the backdrop covering the page.
The drawer and its backdrop both moved up together, by about 310px. That means the page behind the modal scrolled.
overflow: hiddenon the root doesn't stop iOS from scrolling the document, and when it does, things fixed to a viewport that iOS no longer moves slide off with the page. The touch guard from #441 refuses most of those scrolls, but it can only cancel a touch move before the browser starts scrolling, and it can't stop a fling, a focus scroll, or a second finger.How
app.css: while a dialog is open,html.modal-scroll-lock bodyisposition: fixedattop: var(--modal-scroll-top). The page looks exactly where it was, and the document has nothing left to scroll.app.js: the observer that already saved and restored the page position around a modal now also sets that class and offset as the first dialog opens and clears them before scrolling back as the last one closes. The phone header's hide-on-scroll ignores the scroll the lock causes, so it comes back as it was.modal-scroll-lock.cjs: checks that opening a modal leaves the page in place, pins the body, leaves the document nothing to scroll, and that closing unpins and restores the position.Screenshots
An Insights device drawer opened from about 900px down the page. Headless Chromium doesn't scroll a frozen root the way iOS does, so before and after look the same (only the demo's times differ). They show the lock doesn't move the page or the drawer. The fix itself needs checking on an iPhone.
main)Checks
go test ./internal/web/...passes.mainin this container.