Skip to content

Commit

Permalink
Selected options are shown on top
Browse files Browse the repository at this point in the history
  • Loading branch information
eronisko committed Apr 25, 2024
1 parent 90808fe commit 22755a0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion resources/js/components/catalog-new/SelectOptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down

0 comments on commit 22755a0

Please sign in to comment.