Repository navigation
fix(overlay): keep the iOS toolbar area dimmed for side modals - #709
Merged
Merged
Conversation
Render the Overlay backdrop outside of the fixed overlay root and switch it to absolute positioning on iOS, following the Base UI approach. iOS Safari fills its toolbar area with the color of fixed elements attached to the bottom edge, which turned the area behind the toolbar black for side modals. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKGZMkoaXqFb4Qs9NAuT76
size-limit report 📦
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKGZMkoaXqFb4Qs9NAuT76
Swipe updates now set the backdrop opacity through a variable read only by the visible state. The backdrop is no longer inside the root, so an inline opacity reset after the modal transition made it jump back to full opacity on close. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKGZMkoaXqFb4Qs9NAuT76
Safari renders page content under the status bar and the floating toolbar, outside the viewport, so the backdrop now extends past the viewport edges on iOS instead of stopping at them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKGZMkoaXqFb4Qs9NAuT76
Safari samples the fixed layers a few pixels away from the screen edges to color its toolbars. The shadow of the floating side modals reached that area and turned the toolbar into an opaque bar instead of showing the overlay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKGZMkoaXqFb4Qs9NAuT76
Render an invisible fixed strip with the overlay color at the top screen edge. Safari uses the background color of fixed elements attached to the top edge for its top bar, so it stays solid with the dimmed color in both scroll states instead of showing the page background or fading the scrolled content. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKGZMkoaXqFb4Qs9NAuT76
This reverts commit afb6d92. Safari's default top bar is kept instead of the invisible top edge strip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKGZMkoaXqFb4Qs9NAuT76
This reverts commit 6300f36. Safari's default solid toolbar is kept for side modals instead of removing their shadow to keep the toolbar see-through. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKGZMkoaXqFb4Qs9NAuT76
…nd the full-screen modal background Restores the side modal shadow removal on iOS, so Safari keeps rendering the dimmed overlay under its toolbar instead of an opaque bar. Full-screen modals extend their background past the screen edges on iOS, so the overlay doesn't show as a line between the modal and the toolbars tinted with its color. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKGZMkoaXqFb4Qs9NAuT76
- Scope the iOS backdrop and modal shadow overrides to non-contained elements instead of resetting them for contained ones - Remove unused offset variable defaults on the backdrop - Use inset shorthands and drop guards covered by the backdrop ref check - Fix comments describing a single screen edge No computed style changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKGZMkoaXqFb4Qs9NAuT76
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.
Summary
On iOS 26+ Safari, a dimming overlay turned the area behind the floating URL bar into a solid dark bar instead of showing the dimmed page.
Safari decides its bar colors from fixed elements touching the screen edges (WebKit
LocalFrameView::fixedContainerEdges). It hit-tests each edge's midpoint and takes the first fixed ancestor of suitable size as a container. It fills the bar with that container's background color, or, if it has none, with the predominant color of a 2px strip 4–6px from the edge, sampling fixed and sticky layers only. If no fixed container is found, the bar shows the page content underneath. The Overlay backdrop lived inside the fixed overlay root, so the dimming color was sampled and painted as a solid bar.This follows what Base UI does for its Dialog and Drawer:
pointer-events: none,z-indexfixed, painted below the root). On iOS it switches toposition: absolute(@supports (-webkit-touch-callout: none)), so it's left out of Safari's fixed-layer sample. Other browsers keepposition: fixed; inset: 0.50lvhpast the viewport on both sides, and a layout effect lines it up with the viewport.start/endmodals sit 8px from the screen edges, so their shadow reached Safari's sample strip at roughly 0.1 alpha and became an opaque bar. Their shadow is removed on iOS (--rs-modal-floating-shadow).--rs-modal-full-screen-shadow, a50lvhspread shadow), so the bled backdrop can't show as a line between the modal and the bars.--rs-overlay-backdrop-opacity, which only the visible state reads. Writingopacityinline kept the backdrop at full opacity during the close transition now that it is no longer faded with the root.Toolbar behavior with this PR:
.edgestrip and the full-screen one by covering the edge.Related Issue
None.
Screenshots / Recordings
Verify on a real iOS device. Open the stories directly through
iframe.html(not inside the Storybook manager):Notes for Reviewers
.edgestrip.position: relativebody, the backdrop spans from half a viewport above to half a viewport below the visible area, and the modal still closes.Image > onLoad, which loads an external Unsplash URL.🤖 Generated with Claude Code
https://claude.ai/code/session_01TKGZMkoaXqFb4Qs9NAuT76