-
-
Notifications
You must be signed in to change notification settings - Fork 537
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(Android): formSheet flex 1 support #2462
base: main
Are you sure you want to change the base?
Conversation
The bugfix needs React Navigation to change this import, but this bugfix doesn't depend on React Navigation doing it first. Even if you merge it first here and React Navigation bumps the version afterwards, the outcome is the same. So please go ahead with merging and releasing this first. That way I can bump the version in React Navigation and make releases once. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest moving/copying explanation from PR to code comments - that way when someone is reading the code it'll be more obvious what's happening without having to visit PRs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I won't approve this until we understand why this works. I don't get why setting maxHeight
this way would impact the layout as it did.
If you're able - please provide us with some insights - otherwise I'll be able to dive into it ~todays afternoon tomorrow morning
@kkafar I added few more lines to description to make it more clear. Basically changing the styles on android from Then, as I was testing the changes with various sheet contents, I had to add |
@alduzy do you have any workaround suggestion for this? |
@RodolfoSilva Don't use |
This PR was originally posted in react-navigation: react-navigation/react-navigation#12196
Since #2433 the changes should be applied here.
This change relies on replacing
ScreenStackContent
in react-navigation with thisScreenStackItem
component imported from react-native-screens.Until it's done this PR is a draft.Keep that in mind if you want to test this change.Description
This PR intents to add
flex: 1
support to android formSheets. Currently when you setflex: 1
style to a wrapper component (quite usual thing to do) inside a screen withpresentation: 'formSheet'
it doesn't show up on android. On iOS it works fine.This adjustment prevents the android sheet from breaking when given the
flex: 1
style and ensures that its behaviour aligns better with iOS.While iOS is given sheet specific styles, Android receives
null
. Passing same styles to both platforms makes theflex: 1
work as expected. To ensure that the scrollview on Android knows it's height and scrolls properly, amaxHeight: '100%'
style is added.Additionally, on Android there's no header in
formSheet
presentation. Thus we want to explicitly set it to hidden, as it may influence the content's layout.Changes
formSheet
presentation.Test2462.tsx
reproScreenshots / GIFs
Before
After
Test code and steps to reproduce
Test2462.tsx
reproChecklist