Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

- **Android**: A sheet whose keyboard starts rising as the present slide ends, such as one that focuses an input around `onWillPresent`, now finishes presenting. It used to never fire `onDidPresent` or resolve `present()`, and kept swallowing taps. ([#1012](https://github.com/lodev09/react-native-true-sheet/pull/1012) by [@JacquesLeupin](https://github.com/JacquesLeupin))
- **Android**: When a sheet presented over another sheet changes its content size right before it dismisses, the sheet behind it now slides back instead of staying pushed down and not draggable. ([#1015](https://github.com/lodev09/react-native-true-sheet/pull/1015) by [@idlework](https://github.com/idlework))
- **Android**: The keyboard no longer counts against `maxContentHeight`, as on iOS. A sheet now rises above the keyboard instead of stopping at `maxContentHeight` with the keyboard covering the bottom of its content, such as a button below a text input. A sheet already at `maxContentHeight` now rises with the keyboard too, instead of staying put. ([#1017](https://github.com/lodev09/react-native-true-sheet/pull/1017) by [@wildseansy](https://github.com/wildseansy))

### 💡 Others

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ class TrueSheetDetentCalculator(private val reactContext: ThemedReactContext) {
} else {
0
}
val height = baseHeight + keyboardHeight - footerKeyboardOverlap
val maxAllowedHeight = screenHeight + contentBottomInset
return maxContentHeight?.let { minOf(height, it, maxAllowedHeight) } ?: minOf(height, maxAllowedHeight)
// maxContentHeight caps the content; the keyboard lifts the sheet on top of it, as on iOS.
val cappedHeight = minOf(baseHeight - footerKeyboardOverlap, maxContentHeight ?: Int.MAX_VALUE)
return minOf(cappedHeight + keyboardHeight, screenHeight + contentBottomInset)
}

fun getBackgroundIndex(sheetTop: Int, displayedIndex: Int): Int {
Expand Down
Loading