File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Crane/app/src/main/java/androidx/compose/samples/crane/base Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ import androidx.compose.material.Text
32
32
import androidx.compose.runtime.Composable
33
33
import androidx.compose.runtime.getValue
34
34
import androidx.compose.runtime.mutableStateOf
35
- import androidx.compose.runtime.remember
35
+ import androidx.compose.runtime.saveable.rememberSaveable
36
36
import androidx.compose.runtime.setValue
37
37
import androidx.compose.samples.crane.R
38
38
import androidx.compose.samples.crane.ui.CraneTheme
@@ -87,7 +87,12 @@ fun CraneEditableUserInput(
87
87
@DrawableRes vectorImageId : Int? = null,
88
88
onInputChanged : (String ) -> Unit
89
89
) {
90
- var textFieldState by remember { mutableStateOf(TextFieldValue ()) }
90
+
91
+ var textFieldState by rememberSaveable(stateSaver = TextFieldValue .Companion .Saver ) {
92
+ mutableStateOf(
93
+ TextFieldValue ()
94
+ )
95
+ }
91
96
CraneBaseUserInput (
92
97
caption = caption,
93
98
tintIcon = {
You can’t perform that action at this time.
0 commit comments