Is there some behaviour difference between `BasicT...
# compose
c
Is there some behaviour difference between
BasicTextField
and
TextField
with respect to cursor placement and/or LTR/RTL behaviour? The code below produces a text field where the cursor stays to the left, and thus text comes out “backwards” as you type. A
TextField
with the same parameters works as expected. Thanks!
Copy code
BasicTextField(
          value = TextFieldValue(text),
          onValueChange = { onValueChange(it.text) },
          textStyle = TextStyle.Default.copy(
            color = Color.White,
            fontSize = fontSize.em,
            fontWeight = FontWeight.Bold,
          ),
          enabled = /* calculated from some state */,
          modifier = Modifier
            .fillMaxWidth()
            .padding(16.dp),
          keyboardOptions = KeyboardOptions(
            autoCorrect = false,
          ),
        )
Nevermind, these were the critical lines I was missing
Copy code
var textFieldValueState by remember { mutableStateOf(TextFieldValue(text = value)) }
    val textFieldValue = textFieldValueState.copy(text = value)