Skip to content

fix(overlay, modal): keep the iOS backdrop out of the page scroll and end edge modals above the keyboard - #723

Merged
blvdmitry merged 1 commit into
mainfrom
claude/happy-lovelace-517cdv
Nov 22, 2026
Merged

blvdmitry merged 1 commit into
mainfrom
claude/happy-lovelace-517cdv

Conversation

@blvdmitry

Copy link
Copy Markdown
Contributor

Summary

Overlay backdrop on iOS no longer makes the document scrollable. #709 positioned the backdrop absolutely on iOS and let it bleed past the viewport by making it 100dvh + 2 × 50lvh tall. The bottom half of that bleed counts toward the document's scrollable area, so while any overlay is open the page can be scrolled by half a screen, even with overflow: hidden on the body. Safari then scrolls the page to reveal focused fields, and iOS 26 blurs the status bar area over a scrolled page. In Untap this showed as a blurred top edge over open modals.

The bleed is now a spread box-shadow on a viewport-sized backdrop. A shadow only paints and doesn't count toward the scrollable area. Checked in Chromium with the iOS styles forced on: an 800px viewport went from a 1200px scroll height (and scrollTo reaching 400px) to 800px with no scroll.

Modals attached to the screen edges end above the on-screen keyboard. bottom, start, end and full-screen modals used --rs-modal-keyboard-height only to drop the bottom safe area, so they still ran on under the keyboard. Their bottom inset now includes the keyboard height (max-height too, for bottom), so their whole content can be scrolled to without the page being panned. center is unchanged because the overlay scrolls it.

Related Issue

The blurred top edge and the unreachable modal top in Untap's page modal on iOS.

Screenshots / Recordings

Not tested on an iOS device yet. Both changes only show in iOS Safari or a home screen app.

Notes for Reviewers

  • The Modal "test: virtual keyboard" browser test now also checks that the modal ends 300px higher while the keyboard is up and comes back down after. It fails without the CSS change.
  • inset-block: auto <keyboard> is used rather than initial, because a CSS-wide keyword can't be combined with other values in a shorthand, so the whole declaration was dropped.
  • The iOS backdrop rules are behind @supports (-webkit-touch-callout: none), so Chromium tests can't cover them. Please check on a phone that the overlay still reaches under the status bar and the toolbar.
  • Overlay.tsx alignment no longer reads marginTop, since the backdrop no longer has one.

Generated by Claude Code

… end edge modals above the keyboard

- Overlay backdrop on iOS bleeds past the viewport with a spread shadow instead of
  its own height. The taller backdrop made the document scrollable while an overlay
  was open, so Safari scrolled the page to reveal focused fields and blurred the
  status bar area over the scrolled page.
- Modal with bottom, start, end and full-screen positions ends above the on-screen
  keyboard when the layout isn't resized for it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TKGZMi1nf8CnLci2kLKjSy
@github-actions

Copy link
Copy Markdown

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
Library / JS 54.01 KB (-0.19% 🔽) 1.1 s (-0.19% 🔽) 0 ms (+100% 🔺) 1.1 s
Library / CSS 24.88 KB (-0.02% 🔽) 498 ms (-0.02% 🔽) 0 ms (+100% 🔺) 498 ms
Theming / JS 7.8 KB (0%) 156 ms (0%) 159 ms (+108.09% 🔺) 315 ms
Theming with a default theme definition / JS 8.68 KB (0%) 174 ms (0%) 141 ms (-10.16% 🔽) 314 ms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants