You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due to technical issues in platform component integration with `react-native`, `presentation: 'formSheet'` has limited support for `flex: 1`. The tradeoff is necessary to prevent ["sheet flickering" problem on iOS](https://github.com/software-mansion/react-native-screens/issues/1722). Work on the problem is [in progress](https://github.com/software-mansion/react-native-screens/pull/2748).
1042
+
1043
+
Currently on Android, using `flex: 1` on a top-level content container passed to a `formSheet` with `showAllowedDetents: 'fitToContents'` causes the sheet to not display at all, leaving only the dimmed background visible.
1044
+
1045
+
Unfortunately, even if you don't use `flex: 1` but the content's height is less than max screen height, the rest of the sheet might become translucent or use the default theme background color (you can see this happening on the screenshots in the descrption of [this PR](https://github.com/software-mansion/react-native-screens/pull/2462)). To match the sheet to the background of your content, set `backgroundColor` in the `contentStyle` prop of the given screen.
1046
+
1047
+
On Android, there are also some problems with getting nested ScrollViews to work properly. The solution is to set `nestedScrollEnabled` on the `ScrollView`, but this does not work if the content's height is less than the `ScrollView`'s height. Please see [this PR](https://github.com/facebook/react-native/pull/44099) for details and suggested [workaround](https://github.com/facebook/react-native/pull/44099#issuecomment-2058469661).
1048
+
:::
1049
+
1050
+
#### `sheetAllowedDetents`
1051
+
1052
+
:::note
1053
+
1054
+
Works only when `presentation` is set to `formSheet`.
Whether the sheet should expand to larger detent when scrolling.
1109
+
1110
+
Defaults to `true`.
1111
+
1112
+
Only supported on iOS.
1113
+
1114
+
:::warning
1115
+
1116
+
Please note that for this interaction to work, the ScrollView must be "first-subview-chain" descendant of the Screen component. This restriction is due to platform requirements.
1117
+
1118
+
:::
1119
+
1120
+
#### `sheetCornerRadius`
1121
+
1122
+
:::note
1123
+
1124
+
Works only when `presentation` is set to `formSheet`.
**Index** of the detent the sheet should expand to after being opened.
1153
+
1154
+
If the specified index is out of bounds of `sheetAllowedDetents` array, in dev environment more errors will be thrown, in production the value will be reset to default value.
1155
+
1156
+
Additionaly there is `last` value available, when set the sheet will expand initially to last (largest) detent.
1157
+
1158
+
Defaults to `0` - which represents first detent in the detents array.
1159
+
1160
+
Only supported on Android and iOS.
1161
+
1162
+
#### `sheetGrabberVisible`
1163
+
1164
+
:::note
1165
+
1166
+
Works only when `presentation` is set to `formSheet`.
The largest sheet detent for which a view underneath won't be dimmed.
1193
+
1194
+
This prop can be set to an number, which indicates index of detent in `sheetAllowedDetents` array for which there won't be a dimming view beneath the sheet.
1195
+
1196
+
Additionaly there are following options available:
1197
+
1198
+
-`none` - there will be dimming view for all detents levels,
1199
+
-`last` - there won't be a dimming view for any detent level.
1200
+
1201
+
Defaults to `none`, indicating that the dimming view should be always present.
0 commit comments