If the 2 Item has the same value, when one is selected (hovered) both items will receive the data-selected=true attribute, which makes both of them selected.
<>
<Item onSelect={(): void => select(1)}>
Value 1
</Item
<Item onSelect={(): void => select(2)}>
Value 1
</Item
</>
Hovering the first Item will also selet the second Item.
If the 2
Item
has the same value, when one is selected (hovered) both items will receive thedata-selected=true
attribute, which makes both of them selected.Hovering the first
Item
will also selet the secondItem
.After a quick check the reason is possibly here:
https://github.com/prestonbourne/cmdk/blob/c7364e1e552788b842c840f68f9c159ad5810d04/cmdk/src/index.tsx#L583C3-L583C84
That the
selected
is set on value check.Update:
It's actually stated in the docs:
However, I still think this should be changed.