Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 🐛 empty array sets no edges #378

Merged
merged 1 commit into from
Apr 26, 2023

Conversation

VNDRN
Copy link
Contributor

@VNDRN VNDRN commented Apr 25, 2023

Summary

As #204 states, providing an empty array as edges to the SafeAreaView component should result into no edges being set. When the edges prop is omitted, all edges should still be set as default

Test Plan

I've tested this on an iPhone 14 Pro

<SafeAreaView edges={[]} style={{ backgroundColor: 'blue', flex: 1 }}>
      <View style={{ backgroundColor: 'red', flex: 1 }} />
 </SafeAreaView>
no edges (defaults to all) edges={['bottom']} edges={[]}
IMG_3120 IMG_3121 IMG_3119

@VNDRN
Copy link
Contributor Author

VNDRN commented Apr 25, 2023

I haven't been able to test if a change needs to be made for android

Copy link
Collaborator

@jacobp100 jacobp100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Android defaults to an empty set of edges

It'd be really useful if we could confirm on Android we haven't broken anything. Maybe we could ask in the PR if someone is able to check for us

@VNDRN
Copy link
Contributor Author

VNDRN commented Apr 26, 2023

I've tried simulating display cutouts with developer options, but couldn't provide any. As this is an iOS only change, it shouldn't affect android though?

@jacobp100
Copy link
Collaborator

@janicduplessis happy for this to go in?

@janicduplessis janicduplessis changed the title 🐛 empty array sets no edges fix: 🐛 empty array sets no edges Apr 26, 2023
@janicduplessis
Copy link
Member

Looks good, not sure if the same bug exists on android, but if it does we can fix it later, this will only affect iOS.

@janicduplessis janicduplessis merged commit 5ea2592 into th3rdwave:main Apr 26, 2023
@VNDRN VNDRN deleted the feature/empty-array-no-edges branch April 26, 2023 13:33
@VNDRN VNDRN restored the feature/empty-array-no-edges branch April 26, 2023 13:33
@jacobp100 jacobp100 mentioned this pull request May 9, 2023
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.

3 participants