fix: macOS Designed for iPhone — liquid glass background + mouse drag support#598
Open
isaacrowntree wants to merge 2 commits intolodev09:mainfrom
Open
Conversation
|
@isaacrowntree is attempting to deploy a commit to the Jovanni's projects Team on Vercel. A member of the Team first needs to authorize it. |
isaacrowntree
added a commit
to isaacrowntree/truesheet-macos-liquid-glass-repro
that referenced
this pull request
Mar 10, 2026
…hone Demonstrates that sheet.backgroundEffect (UIColorEffect) is ignored on macOS compatibility layer, causing liquid glass to show through instead of the configured backgroundColor. Ref: lodev09/react-native-true-sheet#598
… support
Two fixes for macOS "Designed for iPhone/iPad" compatibility mode:
1. **Liquid glass background**: `sheet.backgroundEffect` with `UIColorEffect`
is silently ignored on Mac, causing liquid glass to show instead of the
configured `backgroundColor`. Fix: remove the early return when
`isiOSAppOnMac`, so `view.backgroundColor` is also set as a fallback.
2. **Mouse drag gestures**: `UISheetPresentationController`'s built-in pan
gesture doesn't respond to mouse/trackpad input on Mac. Fix: add a custom
`UIPanGestureRecognizer` on the presented view (guarded by `isiOSAppOnMac`)
that computes a projected landing position on release using drag translation
+ velocity, then snaps to the nearest detent. Mimics native iOS release
behavior without mid-drag jitter.
- Gesture is on `presentedView` only (header/grabber area) — scroll view
content remains scrollable at any detent.
- Uses `resolvedHeightForIndex:` (now exposed in `TrueSheetDetentCalculator.h`)
for accurate detent position calculations.
- Detection: `NSProcessInfo.processInfo.isiOSAppOnMac` (iOS 14+).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
14d92cb to
e9bead6
Compare
|
Hey @isaacrowntree, this PR is missing a changelog entry. Add the following under the Unreleased section in See CONTRIBUTING.md for more details. |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
Two fixes for macOS "Designed for iPhone/iPad" compatibility mode (Apple Silicon):
1. Liquid glass background
sheet.backgroundEffectwithUIColorEffectis silently ignored by the macOS compatibility layer. This causes the default iOS 26 liquid glass material to show through instead of the configuredbackgroundColor. The same binary works correctly on real iOS devices (tested iPhone 17 Pro, iOS 26.2).Fix: Remove the early
returnwhenNSProcessInfo.processInfo.isiOSAppOnMacisYES, soview.backgroundColoris also set as a fallback alongsidebackgroundEffect.2. Mouse drag gestures
UISheetPresentationController's built-in pan gesture doesn't respond to mouse/trackpad input on Mac. Users can only interact with the sheet by tapping the grabber.Fix: Add a custom
UIPanGestureRecognizeron thepresentedView(guarded byisiOSAppOnMac) that computes a projected landing position on release using the drag's cumulative translation + velocity (decelerating over ~0.3s), then snaps to the nearest detent. This mimics native iOS release-to-snap behavior.resolvedHeightForIndex:(now exposed inTrueSheetDetentCalculator.h) for accurate detent position calculationsNSProcessInfo.processInfo.isiOSAppOnMac(iOS 14+) — zero change on real iOS devicesTest plan
backgroundColor, no liquid glassbackgroundColorsetbackgroundBlurset (nobackgroundColor)dismissible={false}anddismissible={true}Reproduction app: https://github.com/isaacrowntree/truesheet-macos-liquid-glass-repro
🤖 Generated with Claude Code