```OutlinedTextField( modifier = Modifier....
# compose-desktop
s
Copy code
OutlinedTextField(
        modifier = Modifier.fillMaxWidth(),
        value = text,
        onValueChange = { text = it },
        label = { Text("please input sth.") },
        trailingIcon = {
            Icon(Icons.Filled.Delete, contentDescription = "", modifier = Modifier.clickable(onClick = 
            }))
        }
    )
show my code
t
can u tell what's
text
here?
s
Copy code
var text by rememberSaveable(stateSaver = TextFieldValue.Saver) {
    mutableStateOf(TextFieldValue("ssssss", TextRange(0, 10)))
}
is there any other associated settings?
j
Have you tried adding some logging statements? For example, log in
onValueChange
to see if the lambda is getting invoked, try logging the value of text before and after you set it, try logging right above
OutlinedTextField
to ensure it is getting recomposed, etc.
If you've already done the logging, can you share the insights? Might help narrow down where/why you're not seeing updates
s
Copy code
var text by remember { mutableStateOf("abc") }
That’s fine!
This time i use another constructor。
Copy code
fun OutlinedTextField(
    value: String,
t
@Sololo I tried ur code and it works good for me.
message has been deleted
s
my new code? value is String Type
t
Copy code
var text by rememberSaveable(stateSaver = TextFieldValue.Saver) {
            mutableStateOf(TextFieldValue("ssssss", TextRange(0, 10)))
        }

        OutlinedTextField(
            modifier = Modifier.fillMaxWidth(),
            value = text,
            onValueChange = { text = it },
            label = { Text("please input sth.") },
            trailingIcon = {
                Icon(Icons.Filled.Delete, contentDescription = "", modifier = Modifier.clickable(onClick = {
                }))
            }
        )
this code. ☝️
s
let me try again
THE “sssss” can’t be modified
t
s
In my case, the cursor won’t show😪
t
review last modifications