Skip to content

Commit fc62266

Browse files
committed
fix(android): reposition footer when keyboard hides via IME action button
1 parent 4eea6f9 commit fc62266

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

android/src/main/java/com/lodev09/truesheet/TrueSheetViewController.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -821,14 +821,19 @@ class TrueSheetViewController(private val reactContext: ThemedReactContext) :
821821
setupSheetDetents()
822822
if (!isDismissing && detentIndexBeforeKeyboard >= 0) {
823823
setStateForDetentIndex(detentIndexBeforeKeyboard)
824-
detentIndexBeforeKeyboard = -1
825824
}
826825
}
827826

828-
override fun keyboardDidHide() {}
827+
override fun keyboardDidHide() {
828+
if (!shouldHandleKeyboard(checkFocus = false)) return
829+
detentIndexBeforeKeyboard = -1
830+
positionFooter()
831+
}
829832

830833
override fun keyboardDidChangeHeight(height: Int) {
831-
if (!shouldHandleKeyboard()) return
834+
// Skip focus check if already handling keyboard (focus may be lost during hide)
835+
val isHandlingKeyboard = detentIndexBeforeKeyboard >= 0
836+
if (!shouldHandleKeyboard(checkFocus = !isHandlingKeyboard)) return
832837
positionFooter()
833838
}
834839
}

0 commit comments

Comments
 (0)