Skip to content

Commit

Permalink
fix: ensure imeHeight is always positive (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
ColeKainzRSG authored Sep 6, 2024
1 parent f3b3952 commit f9b1d6a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class SafeArea(private val activity: Activity, private val webView: WebView) {

// To get the actual height of the keyboard, we need to subtract the height of the system bars from the height of the ime
// Source: https://stackoverflow.com/a/75328335/8634342
val imeHeight = imeInsets.bottom - systemBarsInsets.bottom
val imeHeight = (imeInsets.bottom - systemBarsInsets.bottom).coerceAtLeast(0)

// Set padding of decorview so the scroll view stays correct.
// Otherwise the content behind the keyboard cannot be viewed by the user.
Expand Down

0 comments on commit f9b1d6a

Please sign in to comment.