Skip to content

Commit

Permalink
fix: keyboard flicker after sending messages
Browse files Browse the repository at this point in the history
replaces `keyboardController.hide()` with `focusManager.clearFocus()`
  • Loading branch information
andrekir committed Dec 10, 2024
1 parent 1a67ea8 commit 2110183
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/src/main/java/com/geeksville/mesh/ui/message/Message.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 2110183

Please sign in to comment.