mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-30 03:38:54 +01:00
fix(CommandPalette): keep ignoreFilter groups at their place (#2833)
This commit is contained in:
@@ -220,14 +220,15 @@ const groups = computed(() => {
|
|||||||
return getGroupWithItems(group, items)
|
return getGroupWithItems(group, items)
|
||||||
}).filter(group => !!group)
|
}).filter(group => !!group)
|
||||||
|
|
||||||
const nonFuseGroups = props.groups?.filter(group => group.ignoreFilter && group.items?.length).map((group) => {
|
const nonFuseGroups = props.groups
|
||||||
return getGroupWithItems(group, group.items || [])
|
?.map((group, index) => ({ ...group, index }))
|
||||||
}) || []
|
?.filter(group => group.ignoreFilter && group.items?.length)
|
||||||
|
?.map(group => ({ ...getGroupWithItems(group, group.items || []), index: group.index })) || []
|
||||||
|
|
||||||
return [
|
return nonFuseGroups.reduce((acc, group) => {
|
||||||
...fuseGroups,
|
acc.splice(group.index, 0, group)
|
||||||
...nonFuseGroups
|
return acc
|
||||||
]
|
}, [...fuseGroups])
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user