mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
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 }
|
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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user