jannis
10/25/2021, 10:23 AMTextField
with a TextFieldValue
. When I select a Text the onValueChange
callback is invoked correctly. However when I perform a configuration change the `onValueChange`callback is invoked again (before the recomposition is invoked). This time with wrong values. The selection is cleared.
When I use a remembersaveable
it works more or less. It seems the selection is restored with the correct values (even though the context menu on the text is missing). It seems it simply doesn't update it before the recomposition.
Since my state is more complex I store the value in my ViewModel
. Of course the value get's updated with the wrong state before the recomposition.
Any ideas how to solve this? Or is it a bug?jannis
10/25/2021, 10:44 AMjannis
10/25/2021, 1:26 PMAlbert Chang
10/25/2021, 1:32 PMjannis
10/25/2021, 1:36 PMSteffen Funke
10/29/2021, 10:07 AMWhen I use aMight you have any hint how you gotit works more or less.remembersaveable
rememberSaveable
working with a TextfieldValue
? I struggle a bit with a custom Saver object creation, since TextfieldValue
is not parcelable by itself…Steffen Funke
10/29/2021, 10:12 AMvar textValue by rememberSaveable(stateSaver = TextFieldValue.Saver) {
mutableStateOf(TextFieldValue())
}
Nevermind 🙂jannis
10/29/2021, 11:24 AM