Skip to content

Commit

Permalink
Revert "Revert "fix: items sort by not working (#182)""
Browse files Browse the repository at this point in the history
This reverts commit be9ff15.
  • Loading branch information
pacocoursey committed Feb 6, 2024
1 parent 2fd57ac commit de0e28d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmdk/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,8 @@ const Command = React.forwardRef<HTMLDivElement, CommandProps>((props, forwarded
// 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) => {
Expand Down

0 comments on commit de0e28d

Please sign in to comment.