In short: using Jetpack Compose, the keyboard overlaps the TextField when it is opened in an AlertDialog. I've tried everything I've found:
added android:windowSoftInputMode="adjustResize"
to the Activity in AndroidManifest.xml
set decorFitsSystemWindows = false
on the DialogProperties
called WindowCompat.setDecorFitsSystemWindows(window, false)
for the dialog's window
called WindowCompat.setDecorFitsSystemWindows(window, false)
in the Activity's onCreate()
method
used this ImeState
approach from: https://www.youtube.com/watch?v=kgoJfl_Oc5E
used the BringIntoViewRequester
:
modifier
.onFocusEvent {
if (it.isFocused) {
coroutineScope.launch {
delay(200)
bringIntoViewRequester.bringIntoView()
}
}
}
.bringIntoViewRequester(bringIntoViewRequester)
I've created a GitHub repository with a demo project: Demo project - TextField covered by keyboard
Can you help me to understand what am I missing? I'm completely out of ideas.
Based on the answer of @Shubham Thorat, I used adjustPan
in the following way:
android:windowSoftInputMode="adjustPan"
LaunchedEffect(imeState.value)
:
WindowCompat.setDecorFitsSystemWindows(wnd, false)
wnd.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN)
Can you try this one:
android:windowSoftInputMode="adjustPan"