Skip to content

Conversation

@t0maboro
Copy link
Contributor

@t0maboro t0maboro commented Oct 23, 2025

Description

Update the logic of returned insets for SAV component used with the formSheet to define the available space on Android. From now on, the size of the formSheet is constrained by the maximum detent, and the content size equals the formSheet size with insets coming from systemBars or ime subtracted, depending on the test case.

Fixes: https://github.com/software-mansion/react-native-screens-labs/issues/457

Changes

  • Updated the logic for consuming insets in the SheetDelegate
  • Updated the definition of SheetBehavior for 3 detents - constraining the size with maxHeight
  • 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

before.mov

After

after.mov

Test code and steps to reproduce

Added Test3336 for testing.

Checklist

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

@t0maboro t0maboro force-pushed the @t0maboro/form-sheet-flex-end branch from bb6e584 to 76ef71f Compare October 30, 2025 09:18
@t0maboro t0maboro changed the title fix(Android, FormSheet): Add SAV for defining formSheet bounds fix(Android, FormSheet): Fix formSheet - SafeAreaView integration Oct 30, 2025
@t0maboro t0maboro marked this pull request as ready for review October 30, 2025 09:52
@t0maboro t0maboro changed the title fix(Android, FormSheet): Fix formSheet - SafeAreaView integration fix(Android, Stack): Fix formSheet - SafeAreaView integration Oct 30, 2025
Copy link
Contributor

@kligarski kligarski left a comment

Choose a reason for hiding this comment

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

Looks great!

I have 2 questions:

  • did you check older Android APIs as well?
  • did you check how this behaves with changes from #3248?

@t0maboro
Copy link
Contributor Author

t0maboro commented Nov 3, 2025

  • did you check older Android APIs as well?

Yes, I went down to 28

Yes

@t0maboro t0maboro force-pushed the @t0maboro/form-sheet-flex-end branch from 1f05c0c to 9c70d4b Compare November 7, 2025 14:09
@t0maboro
Copy link
Contributor Author

t0maboro commented Nov 7, 2025

Switching to draft, because the additional effort is needed after merging: #3248

@t0maboro t0maboro marked this pull request as draft November 7, 2025 14:13
@t0maboro t0maboro changed the title fix(Android, Stack): Fix formSheet - SafeAreaView integration fix(Android, Stack): Fix FormSheet - SafeAreaView integration Nov 7, 2025
t0maboro added a commit that referenced this pull request Nov 7, 2025
## Description

When using 3 detents, the size of the `formSheet` is calculated based on
the screen size and does not respect the detents. In this PR, I add a
`maxHeight` to `SheetBehavior` when using 3 detents, ensuring the sheet
respects the detent configuration. I also did a minor refactor of this
variable for consistency.

**Note:**
In the example, I'm adding more TCs for better regression testing, but
only 3 detents were broken

**Note:**
With this PR i noticed that the formsheet doesn't respect system bars, I
started working on that issue separately:
#3336

Fixes
software-mansion/react-native-screens-labs#458

## Changes

- Added `maxHeight` for sheetBehavior with 3 detents

## 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/cd800504-0e81-4334-9eeb-dee0baaf913e

### After


https://github.com/user-attachments/assets/15068903-8102-4480-85c5-7147a5212378

## Test code and steps to reproduce

Added a new example for regression testing - with more examples than
just the failing one, just in case.

## Checklist

- [x] Included code example that can be used to test this change
- [x] 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.

3 participants