fix (#2150): text input not clearing after sending message (#2161)

This commit is contained in:
Jeremiah K 2025-06-19 06:25:19 -05:00 committed by GitHub
parent 1928fb64fa
commit 7e0999fdc0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -264,6 +264,8 @@ internal fun MessageScreen(
viewModel.sendMessage(message, contactKey, it.packetId)
replyingTo = null
} ?: viewModel.sendMessage(message, contactKey)
// Clear the text input after sending the message and updating all state
messageInput.value = TextFieldValue("")
}
}
}
@ -465,7 +467,6 @@ private fun TextInput(
val str = message.value.text.trim()
if (str.isNotEmpty()) {
onClick(str)
message.value = TextFieldValue("")
}
true // Consume the event
} else {
@ -483,7 +484,6 @@ private fun TextInput(
val str = message.value.text.trim()
if (str.isNotEmpty()) {
onClick(str)
message.value = TextFieldValue("")
}
}
),
@ -495,7 +495,6 @@ private fun TextInput(
val str = message.value.text.trim()
if (str.isNotEmpty()) {
onClick(str)
message.value = TextFieldValue("")
focusManager.clearFocus()
}
},