From 22755a0560a6131138f326e157286142104e7026 Mon Sep 17 00:00:00 2001 From: Ernest Walzel Date: Thu, 25 Apr 2024 15:01:39 +0200 Subject: [PATCH] Selected options are shown on top --- resources/js/components/catalog-new/SelectOptions.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/resources/js/components/catalog-new/SelectOptions.vue b/resources/js/components/catalog-new/SelectOptions.vue index 808abe393..fd70da505 100644 --- a/resources/js/components/catalog-new/SelectOptions.vue +++ b/resources/js/components/catalog-new/SelectOptions.vue @@ -35,7 +35,12 @@ const options = computed(() => { checked: true, label: formatLabel(value), })), - ] + ].sort((a, b) => { + if (a.checked && b.checked) return 0 + if (a.checked) return -1 + return 1 + }) + return search.value ? matchSorter(optionsWithSelected, search.value, { keys: ['label'],