fix(CommandPalette): keep ignoreFilter groups at their place (#2833)

This commit is contained in:
Benjamin Canac
2024-12-09 10:17:54 +01:00
committed by GitHub
parent 6636543256
commit 3b9ca2263d

View File

@@ -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>