From be9ff155c00651cd5850c828d7fbdfb96207d2f1 Mon Sep 17 00:00:00 2001 From: Paco <34928425+pacocoursey@users.noreply.github.com> Date: Mon, 5 Feb 2024 20:12:16 -0800 Subject: [PATCH] Revert "fix: items sort by not working (#182)" This reverts commit f4049e635b75b2ae66d06354c33d0be378c64ada. --- cmdk/src/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmdk/src/index.tsx b/cmdk/src/index.tsx index f5f068e4..465f4fcf 100644 --- a/cmdk/src/index.tsx +++ b/cmdk/src/index.tsx @@ -380,8 +380,8 @@ const Command = React.forwardRef((props, forwarded // Sort the items getValidItems() .sort((a, b) => { - const valueA = a.getAttribute('id') - const valueB = b.getAttribute('id') + const valueA = a.getAttribute(VALUE_ATTR) + const valueB = b.getAttribute(VALUE_ATTR) return (scores.get(valueB) ?? 0) - (scores.get(valueA) ?? 0) }) .forEach((item) => {