Skip to content

fix: hide closed sheets below edge-to-edge containers - #2754

Open
huytdps13400 wants to merge 1 commit into
gorhom:masterfrom
huytdps13400:fix/2747-closed-sheet-edge-to-edge
Open

fix: hide closed sheets below edge-to-edge containers#2754
huytdps13400 wants to merge 1 commit into
gorhom:masterfrom
huytdps13400:fix/2747-closed-sheet-edge-to-edge

Conversation

@huytdps13400

Copy link
Copy Markdown

Please provide enough information so that others can review your pull request:

Motivation

Fixes #2747.

On Android edge-to-edge devices, Dimensions.get('window').height can exclude system bars while the measured sheet container spans the full screen. A sheet mounted permanently at index={-1} can therefore start above its real closed detent and leave its handle visible.

Initialize the Android position from screen.height, which stays at or below the full-screen container edge. Keep the existing window.height behavior on iOS and web so their mount-animation starting point is unchanged.

Verification

  • RED invariant harness against master: failed while the initial position used window.height
  • GREEN invariant harness: Android selects screen.height, other platforms select window.height
  • yarn typescript
  • yarn build
  • yarn biome check --error-on-warnings src/components/bottomSheet/BottomSheet.tsx
  • git diff --check

Repository-wide yarn lint still reports the existing unrelated optional-chain warning in src/hooks/useBoundingClientRect.ts:54; the changed file is clean.

I could not run the hardware-specific Samsung edge-to-edge reproduction locally. The patch matches the measured window < container == screen geometry and keeps the non-Android path unchanged.

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.

[Bug]: Closed sheets (index={-1}) peek above the bottom edge on Android edge-to-edge — initial position uses Dimensions.get('window').height

1 participant