[fix] Fix action sheet opacity for iOS Liquid Glass#504
Open
Tehnix wants to merge 1 commit into
Open
Conversation
This sets a lower bound for the action sheet opacity to 0.02 on iOS, to work around Liquid Glass limitation on iOS where a too low alpha makes the Liquid Glass background disapear entirely. Relevant documentation https://developer.apple.com/documentation/uikit/uivisualeffectview#Set-the-correct-alpha-value More context expo/expo#41024
|
@Tehnix is attempting to deploy a commit to the Ammar Ahmed's projects Team on Vercel. A member of the Team first needs to authorize it. |
Author
|
@ammarahm-ed let me know if there's any changes needed to this. I've been running it in production for a while and it fixes my issues with Liquid Glass otherwise being broken. I could amend it to be configurable? |
|
+1 to this |
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.
Description
This sets a lower bound for the action sheet opacity to 0.02 on iOS, to work around Liquid Glass limitation on iOS where a too low alpha makes the Liquid Glass background disapear entirely.
I've tested with values lower than
0.02, but these also seem to break Liquid Glass (e.g.0.01will not work). I'm currently using these changes here locally and everything seems to be working nicely.Note that this is a small change to the default value of the opacity on iOS, but I think it's worth not putting behind a prop (or at least making it the default) to avoid people getting a surprising behavior when trying to use Liquid Glass views, which I would assume would only start happening more - not everyone will be lucky to find out that opacity from parent views (even when not active) can break the Liquid Glass views 😅
More info
Screenshots
The above is using Glass Effect from Expo, but from the linked issue independent implementations also run into the opacity issue, e.g. https://github.com/callstack/liquid-glass (callstack/liquid-glass#27 (comment)).