Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] MultiSelectorItem duplicate child #291

Open
thangdevalone opened this issue Jul 29, 2024 · 4 comments
Open

[Bug] MultiSelectorItem duplicate child #291

thangdevalone opened this issue Jul 29, 2024 · 4 comments

Comments

@thangdevalone
Copy link

image
When I hover on the Item it affects 2 items with the same child

@iamabhshk
Copy link

Shall I work on this issue? @pacocoursey

@Akhilathina
Copy link

Yes I am also facing the same issue

@Akhilathina
Copy link

`const CommandItem = React.forwardRef<
React.ElementRef,
React.ComponentPropsWithoutRef

(({ className, ...props }, ref) => (
<CommandPrimitive.Item
ref={ref}
className={cn(
'relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground',
className,
)}
key={props.value}
{...props}
/>
));`

I am using shadcn components, Using key to give unique value to Item solves the issue

@iampava
Copy link

iampava commented Nov 14, 2024

I encountered the same issue. The solution was to have a unique value passed to Command.Item and a different one rendered in the UI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants