diff --git a/app/src/main/kotlin/com/wire/android/ui/common/textfield/StateSyncingModifier.kt b/app/src/main/kotlin/com/wire/android/ui/common/textfield/StateSyncingModifier.kt index f60684e46a7..5080fc0997f 100644 --- a/app/src/main/kotlin/com/wire/android/ui/common/textfield/StateSyncingModifier.kt +++ b/app/src/main/kotlin/com/wire/android/ui/common/textfield/StateSyncingModifier.kt @@ -86,17 +86,17 @@ internal class StateSyncingModifierNode( } private fun observeTextState(fireOnValueChanged: Boolean = true) { - lateinit var text: TextFieldState + lateinit var value: TextFieldValue + observeReads { - text = state + value = TextFieldValue( + state.text.toString(), + state.selection, + state.composition + ) } if (fireOnValueChanged) { - val newValue = TextFieldValue( - text = text.toString(), - selection = text.selection, - composition = text.composition - ) - onValueChanged(newValue) + onValueChanged(value) } } }