Malachi
06/18/2023, 11:38 PMit
only ever registered the first key pressed, as if the previous keystrokes were not saved. Did I miss something in how this works?
example of what I'm trying to do (if needed, I can provide more than just the barebones) :
var textSaver1 by rememberSaveable(stateSaver = TextFieldValue.Saver) { mutableStateOf(TextFieldValue()) }
. . .create 15 more
var textSavers1Through4 = mutableListOf(textsaver1, textsaver2, textsaver3, textsaver4)
Box {
OutlinedTextField( value = textSavers1Through4[0],
onValueChange = {
textSavers1Through4[0] = it
}
)
}
In case it matters, I'm using Kotlin version 1.8.20 and compose version 1.4.0. (And just to be clear - it works as expected if I don't use the mutable list, I'm just confused as to why the mutable list seems to make it not work)Suser
06/19/2023, 12:02 AMtextSavers1Through4[0].value = it?
Malachi
06/19/2023, 12:03 AMSuser
06/19/2023, 12:05 AMMalachi
06/19/2023, 12:06 AMval
for the textsavers originallyMalachi
06/19/2023, 12:09 AMSuser
06/19/2023, 12:10 AMMalachi
06/19/2023, 12:11 AMUnresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public inline operator fun kotlin.text.StringBuilder /* = java.lang.StringBuilder */.set(index: Int, value: Char): Unit defined in kotlin.text
Malachi
06/19/2023, 12:13 AMtextSavers1Through4[0] = it
Suser
06/19/2023, 12:17 AMMalachi
06/19/2023, 12:17 AMSuser
06/19/2023, 12:22 AMMalachi
06/19/2023, 12:22 AMMalachi
06/19/2023, 12:28 AMSuser
06/19/2023, 12:29 AMMalachi
06/19/2023, 12:30 AM