Updated on 2026-08-14
This commit is contained in:
parent
66e7c424f0
commit
4e38f0e822
1 changed files with 5 additions and 3 deletions
|
|
@ -28,8 +28,10 @@ fun LazyListState.HideKeyboardOnScroll() {
|
|||
val context = LocalContext.current
|
||||
val view = LocalView.current
|
||||
LaunchedEffect(firstVisibleItemIndex) {
|
||||
val inputMethodManager =
|
||||
context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
|
||||
inputMethodManager.hideSoftInputFromWindow(view.windowToken, 0)
|
||||
if (firstVisibleItemIndex > 1) {
|
||||
val inputMethodManager =
|
||||
context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
|
||||
inputMethodManager.hideSoftInputFromWindow(view.windowToken, 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue