Dragos Rachieru
09/23/2023, 5:34 PMmaterial3.OutlinedTextField, the cursor is randomly moved one character left when writing text in itDragos Rachieru
09/23/2023, 5:35 PMlinux_x64 with compose version 1.5.10-beta01Dragos Rachieru
09/23/2023, 5:37 PMStateFlow that is being collected:
val state by component.state.collectAsState()
OutlinedTextField(
value = state.name,
onValueChange = component::setName,
label = { Text("Name") },
isError = !state.isNameValid
)ephemient
09/23/2023, 6:09 PMephemient
09/23/2023, 6:10 PMAt the moment, it is not recommended to use reactive streams to define the state variable for TextField.
with
.collectAsState() being the given example of what not to dobenkuly
09/24/2023, 8:39 AM@Composable
fun <T> MutableStateFlow<T>.collectAsStateForTextField() =
collectAsState(Dispatchers.Main.immediate)ephemient
09/24/2023, 5:31 PMDragos Rachieru
09/27/2023, 8:05 AM