@@ -8,6 +8,7 @@ import androidx.compose.foundation.layout.fillMaxSize
88import androidx.compose.foundation.layout.padding
99import androidx.compose.runtime.Composable
1010import androidx.compose.runtime.getValue
11+ import androidx.compose.runtime.mutableStateListOf
1112import androidx.compose.runtime.mutableStateOf
1213import androidx.compose.runtime.remember
1314import androidx.compose.runtime.saveable.rememberSaveable
@@ -34,7 +35,7 @@ fun GroupVoteCreateScreen() {
3435 var isGeneralReview by rememberSaveable { mutableStateOf(false ) }
3536
3637 var title by rememberSaveable { mutableStateOf(" " ) }
37- var options by rememberSaveable { mutableStateOf( mutableListOf ( " " , " " ) ) }
38+ val options = remember { mutableStateListOf( " " , " " ) }
3839
3940 val density = LocalDensity .current
4041 var showTooltip by rememberSaveable { mutableStateOf(false ) }
@@ -81,15 +82,15 @@ fun GroupVoteCreateScreen() {
8182 onTitleChange = { title = it },
8283 options = options,
8384 onOptionChange = { index, newText ->
84- options = options.toMutableList(). also { it [index] = newText }
85+ options[index] = newText
8586 },
8687 onAddOption = {
8788 if (options.size < 5 ) {
88- options = options.toMutableList(). also { it. add(" " ) }
89+ options. add(" " )
8990 }
9091 },
9192 onRemoveOption = { index ->
92- options = options.toMutableList(). also { it. removeAt(index) }
93+ options. removeAt(index)
9394 }
9495 )
9596 }
0 commit comments