From 7b08ab03eee710ba8b9666053869f04648b48c6f Mon Sep 17 00:00:00 2001 From: SAUL Date: Thu, 24 Oct 2024 12:14:37 +0400 Subject: [PATCH] Multi Select dropdown implementation customization --- src/main/kotlin/ui/components/WindowComponents.kt | 2 +- src/main/kotlin/ui/components/forms/PasswordForm.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/ui/components/WindowComponents.kt b/src/main/kotlin/ui/components/WindowComponents.kt index b10a23b..8a1e9a4 100644 --- a/src/main/kotlin/ui/components/WindowComponents.kt +++ b/src/main/kotlin/ui/components/WindowComponents.kt @@ -280,7 +280,7 @@ fun MultiSelectDropdown( focusedLabelColor = foregroundColor ), shape = RoundedCornerShape(8.dp), - value = if (selectedItems.isEmpty()) placeholder else selectedItems.joinToString(", "), + value = if (selectedItems.isEmpty()) placeholder else selectedItems.sortedBy(itemToString).joinToString(", "), onValueChange = { }, textStyle = TextStyle(color = foregroundColor, fontSize = 12.sp, fontFamily = Font.RussoOne), modifier = Modifier diff --git a/src/main/kotlin/ui/components/forms/PasswordForm.kt b/src/main/kotlin/ui/components/forms/PasswordForm.kt index 89d4df0..a4612cb 100644 --- a/src/main/kotlin/ui/components/forms/PasswordForm.kt +++ b/src/main/kotlin/ui/components/forms/PasswordForm.kt @@ -226,7 +226,7 @@ fun PasswordForm( Column(modifier = Modifier.height(80.dp)) { val items = listOf("Apple", "Banana", "Cherry", "Date", "Elderberry") - var selectedItems by remember { mutableStateOf(listOf("Apple")) } + var selectedItems by remember { mutableStateOf(listOf()) } MultiSelectDropdown( items = items,