fix: re-focus text input after voice recording ends
This commit is contained in:
parent
9a81ec5569
commit
4586ee31ea
1 changed files with 8 additions and 0 deletions
|
|
@ -410,6 +410,14 @@ fun TextComposer(
|
||||||
|
|
||||||
SoftKeyboardEffect(showTextFormatting, onRequestFocus) { it }
|
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)
|
val latestOnReceiveSuggestion by rememberUpdatedState(onReceiveSuggestion)
|
||||||
if (state is TextEditorState.Rich) {
|
if (state is TextEditorState.Rich) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue