fix: keyboard flicker after sending messages

replaces `keyboardController.hide()` with `focusManager.clearFocus()`
pull/1455/head
andrekir 2024-12-10 12:56:53 -03:00
rodzic 1a67ea8ad4
commit 2110183d2b
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -67,7 +67,7 @@ import androidx.compose.ui.focus.onFocusEvent
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.ComposeView
import androidx.compose.ui.platform.LocalClipboardManager
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.platform.ViewCompositionStrategy
import androidx.compose.ui.res.colorResource
import androidx.compose.ui.res.pluralStringResource
@ -395,7 +395,7 @@ private fun TextInput(
maxSize: Int = 200,
onClick: (String) -> Unit = {}
) = Column(modifier) {
val keyboardController = LocalSoftwareKeyboardController.current
val focusManager = LocalFocusManager.current
var isFocused by remember { mutableStateOf(false) }
Row(
@ -426,7 +426,7 @@ private fun TextInput(
if (message.value.text.isNotEmpty()) {
onClick(message.value.text)
message.value = TextFieldValue("")
keyboardController?.hide()
focusManager.clearFocus()
}
},
modifier = Modifier.size(48.dp),