fix: give content match a lower score (#4499)

This commit is contained in:
Peng Xiao authored and GitHub committed 2023-09-26 03:15:40 +00:00
1 parent 1bdc402b7b
commit eb728f7ef2
2 files changed
+20 -5

No files matched your search

+2 -2
View File
@@ -365,8 +365,8 @@ const Command = React.forwardRef<HTMLDivElement, CommandProps>(
// Sort the items
getValidItems()
.sort((a, b) => {
const valueA = a.getAttribute(VALUE_ATTR);
const valueB = b.getAttribute(VALUE_ATTR);
const valueA = a.getAttribute('id');
const valueB = b.getAttribute('id');
return (scores.get(valueB) ?? 0) - (scores.get(valueA) ?? 0);
})
.forEach(item => {