Commit cf5dc93
authored
fix(Android, Stack): Fix FormSheet - SafeAreaView integration (#3336)
## Description
Bugfixing the integration between SafeAreaView and FormSheet. I'm
preventing the consumption of the bottom inset, allowing it to be passed
to SAV component. Additionally, I'm adding some other fixes I caught
during testing, for fitToContents and zeroing the bottom inset for
keyboard handling.
> [!WARNING]
> Note:
> We do not manipulate the top inset manually. Therefore, if
`SafeAreaView` has top insets enabled, we must retain the top inset even
if the formSheet does not currently overflow into the status bar.
>
> This is important because in some specific edge cases - for example,
when the keyboard slides in - the formSheet might overlap the status
bar. If we ignored the top inset and it suddenly became necessary, it
would result in a noticeable visual content jump. To ensure consistency
and avoid layout shifts, we always include the top inset upfront, which
can be disabled from the application perspective.
Creating a follow-up ticket for handling some cases that I wasn't able
to cover with SAV:
software-mansion/react-native-screens-labs#565
Fixes:
software-mansion/react-native-screens-labs#457
, #2896
## Changes
- Updated the logic for consuming insets in the `SheetDelegate`
- Added a new example for testing.
## Screenshots / GIFs
Here you can add screenshots / GIFs documenting your change.
You can add before / after section if you're changing some behavior.
### Before
https://github.com/user-attachments/assets/c32fc9f4-63e3-41b2-ab31-110a3ec46d68
### After
https://github.com/user-attachments/assets/647c1674-535e-4dd8-8156-9b490588d123
## Test code and steps to reproduce
Added `Test3336` for testing.
## Checklist
- [x] Included code example that can be used to test this change
- [x] Ensured that CI passes1 parent 82286a2 commit cf5dc93
File tree
4 files changed
+463
-16
lines changed- android/src/main/java/com/swmansion/rnscreens
- bottomsheet
- apps/src/tests
4 files changed
+463
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
145 | 148 | | |
146 | 149 | | |
147 | 150 | | |
| |||
Lines changed: 11 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
| 314 | + | |
314 | 315 | | |
315 | 316 | | |
316 | 317 | | |
317 | 318 | | |
318 | 319 | | |
319 | 320 | | |
320 | 321 | | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | 322 | | |
335 | 323 | | |
336 | 324 | | |
| |||
344 | 332 | | |
345 | 333 | | |
346 | 334 | | |
347 | | - | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
348 | 343 | | |
349 | 344 | | |
350 | 345 | | |
351 | | - | |
352 | | - | |
| 346 | + | |
| 347 | + | |
353 | 348 | | |
354 | 349 | | |
355 | 350 | | |
| |||
0 commit comments