fix: re-focus text input after voice recording ends
This commit is contained in:
+8
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user