Skip to content

Commit 3ca99f5

Browse files
committed
Take max
1 parent 2ee4fb9 commit 3ca99f5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

android/src/main/java/com/swmansion/rnscreens/bottomsheet/SheetDelegate.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,10 +327,10 @@ class SheetDelegate(
327327
val prevSystemBarsInsets = insets.getInsets(WindowInsetsCompat.Type.systemBars())
328328
val prevDisplayCutoutInsets = insets.getInsets(WindowInsetsCompat.Type.displayCutout())
329329

330-
// We save the top inset (status bar height + display cutout) to later
330+
// We save the top inset (status bar height or display cutout) to later
331331
// subtract it from the window height during sheet size calculations.
332332
// This ensures the sheet respects the safe area.
333-
lastTopInset = prevSystemBarsInsets.top + prevDisplayCutoutInsets.top
333+
lastTopInset = maxOf(prevSystemBarsInsets.top, prevDisplayCutoutInsets.top)
334334

335335
if (isImeVisible) {
336336
isKeyboardVisible = true

src/types.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ export interface ScreenProps extends ViewProps {
476476
* Whether the sheet content should be rendered behind the Status Bar or display cutouts.
477477
*
478478
* When set to `true`, the sheet will extend to the physical edges of the stack,
479-
* allowing content to be visible behind the status bar or display cutouts.
479+
* allowing content to be visible behind the status bar or display cutouts.
480480
* Detent ratios in sheetAllowedDetents will be measured relative to the full stack height.
481481
*
482482
* When set to `false`, the sheet's layout will be constrained by the inset from the top

0 commit comments

Comments
 (0)