Skip to content

fix(Android, FormSheet): Apply workaround for controlling insets on BottomSheetBehavior#3611

Open
t0maboro wants to merge 5 commits intomainfrom
@t0maboro/control-insets-on-bottom-sheet-behavior
Open

fix(Android, FormSheet): Apply workaround for controlling insets on BottomSheetBehavior#3611
t0maboro wants to merge 5 commits intomainfrom
@t0maboro/control-insets-on-bottom-sheet-behavior

Conversation

@t0maboro
Copy link
Contributor

@t0maboro t0maboro commented Feb 3, 2026

Description

This PR introduces a workaround to prevent BottomSheetBehavior from handling system window insets that interfere with our custom layout logic.

By manually controlling isGestureInsetBottomIgnored we're bypassing BottomSheetBehavior's internal setWindowInsetsListener, we eliminate unintended top padding caused by default insetTop calculations, taking the responsibility for handling it on our side by sheetShouldOverflowTopInset.

Using the sheetShouldOverflowTopInset prop, we take full control over how the BottomSheet interacts with the system bars, ensuring more control over system insets.

Additionally, there was a 2nd issue related to this problem: expandedOffsetFromTop shouldn't account for the system inset when we're overflowing it. The proper flag for hangling that case for 3 detents was passed to our calculations for expandedOffset.

Closes: https://github.com/software-mansion/react-native-screens-labs/issues/926

Changes

  • Added a workaround that disables isGestureInsetBottomIgnored determined by sheetShouldOverflowTopInset value
  • Updated expandedOffsetFromTop calculations in SheetDetents class

Before & after - visual documentation

Before After
Before.mov
after.mov

Test plan

Added a new TC, regression testing on previously added TC for FormSheets & TestFormSheet.

Checklist

  • Included code example that can be used to test this change.
  • Updated / created local changelog entries in relevant test files.
  • For visual changes, included screenshots / GIFs / recordings documenting the change.
  • For API changes, updated relevant public types.
  • Ensured that CI passes

@t0maboro t0maboro changed the title WIP - fix(Android, FormSheet): Apply workaround for controlling insets on BottomSheetBehavior fix(Android, FormSheet): Apply workaround for controlling insets on BottomSheetBehavior Feb 3, 2026
@t0maboro t0maboro requested a review from kkafar February 3, 2026 13:04
@t0maboro t0maboro force-pushed the @t0maboro/control-insets-on-bottom-sheet-behavior branch from d73f123 to 4895a18 Compare February 4, 2026 15:11
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