Skip to content

fix(Android): missing content when using flex for formsheet contents #2748

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

Merged
merged 3 commits into from
Feb 27, 2025

Conversation

kkafar
Copy link
Member

@kkafar kkafar commented Feb 27, 2025

Description

Fixing the styles applied to the content in screens with formSheet presentation.
Currently when using flex: 1 on the content of the sheet it might cause the content to disappear. This PR mitigates that.

Changes

When not in fitToContents mode we apply flex: 1 to content wrapper.

Test code and steps to reproduce

TestFormSheet - notice that the contents has flex: 1 and it displays correctly.

Checklist

  • Included code example that can be used to test this change
  • Ensured that CI passes

@kkafar kkafar force-pushed the @kkafar/missing-content-when-using-flex branch from 5394570 to f95d114 Compare February 27, 2025 13:01
@kkafar kkafar force-pushed the @kkafar/missing-content-when-using-flex branch from bdea50b to cd15d0f Compare February 27, 2025 13:59
@kkafar kkafar merged commit 905c1a5 into main Feb 27, 2025
1 of 3 checks passed
@kkafar kkafar deleted the @kkafar/missing-content-when-using-flex branch February 27, 2025 14:54
kkafar added a commit that referenced this pull request Mar 10, 2025
…& apply appropriate styles (#2762)

## Description

I've made a small change in v5 code in #2748, however due to my overlook
it introduced a regression in native-stack v5.
Since it is a quick fix I'm patching it. 

Basically I've parsed & transformed `sheetAllowedDetents` value in
`RouteView`, **before** passing it to `MaybeNestedStack`, where
I've checked for `sheetAllowedDetents === 'fitToContents'`, which could
not be true, because in such case it has been transformed to `[-1]`
literal in `RouteView`.

Only the latest 4.10.0-beta.0 & beta.1 versions are affected.

## Changes

Removed `sheetAllowedDetents` prop value transformation in `RouteView`
since `Screen` component handles it nicely internally.

## Test code and steps to reproduce

`TestFormSheet`, but you need to run it using
`createNativeStackNavigator` from `react-native-screens/native-stack`.
Don't forget to change the `presentation` prop to `stackPresentation`,
when changing to v5.

## Checklist

- [ ] Ensured that CI passes
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.

1 participant