Mateu
02/07/2023, 9:55 AMval coroutineScope = rememberCoroutineScope()
val textFlow = remember{ MutableStateFlow("") }
var textFlowState = textFlow.collectAsState(textFlow.value, coroutineScope.coroutineContext)
TextField(
value = textFlowState.value,
onValueChange = { textFlow.value = it }
)
In Android works great, but in compose Desktop when you enter the text fast the cursor does not behave correctly, and some chars are not added to the correct position.
I understand that the problem must be related to this post: https://medium.com/androiddevelopers/effective-state-management-for-textfield-in-compose-d6e5b070fbe5
How can I make it work in both places?Alexander Maryanovsky
02/07/2023, 10:38 AMMateu
02/07/2023, 11:00 AMAlexander Maryanovsky
02/07/2023, 11:02 AMMateu
02/07/2023, 11:16 AMAlexander Maryanovsky
02/07/2023, 11:17 AMLandry Norris
02/07/2023, 6:32 PMMateu
02/17/2023, 2:33 PMbenkuly
04/21/2023, 3:35 PM_.collectAsState_(Dispatchers.Main.immediate)
helps.Mateu
05/10/2023, 10:10 AM