Compose keyboard not close when scrolling
I'm scrolling but keyboard not close
how can i solve this?
thank you in advance for the answers.
If want hide the keyboard on scroll, you need to hide the on the scroll action of your nestedScrollConnection
val keyboardController = LocalSoftwareKeyboardController.current
val nestedScrollConnection = remember {
object : NestedScrollConnection {
override fun onPreScroll(available: Offset, source:NestedScrollSource): Offset {
val delta = available.y
keyboardController?.hide()
return Offset.Zero
}
}
}
Box(Modifier.fillMaxSize().nestedScroll(nestedScrollConnection)) {
LazyColumn(){
// Here your list itens
}
}