Android Jetpack Compose keyboard not close

Viewed 109
1 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
      }
}
Related