From cd60778b8d4bc334cb4a475369dca4d9997a3dfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Saleniuk?= Date: Mon, 27 May 2024 12:49:25 +0200 Subject: [PATCH] fix: send button disabled after writing message [WPB-9421] --- .../ui/common/textfield/StateSyncingModifier.kt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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) } } }