fix: re-focus text input after voice recording ends

This commit is contained in:
Gianluca Iavicoli 2026-04-02 22:20:13 +02:00
parent 9a81ec5569
commit 4586ee31ea
No known key found for this signature in database
GPG key ID: 72FDD0FCF146C74C

View file

@ -410,6 +410,14 @@ fun TextComposer(
SoftKeyboardEffect(showTextFormatting, onRequestFocus) { it }
// Re-focus the text input when voice recording ends so the user can continue typing
var previousVoiceMessageState by remember { mutableStateOf(voiceMessageState) }
LaunchedEffect(voiceMessageState) {
if (voiceMessageState is VoiceMessageState.Idle && previousVoiceMessageState !is VoiceMessageState.Idle) {
onRequestFocus()
}
previousVoiceMessageState = voiceMessageState
}
val latestOnReceiveSuggestion by rememberUpdatedState(onReceiveSuggestion)
if (state is TextEditorState.Rich) {