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

Not able to select options using mouse click in MultiSelector #57

Closed
Swaraj2004 opened this issue Mar 13, 2024 · 6 comments
Closed

Not able to select options using mouse click in MultiSelector #57

Swaraj2004 opened this issue Mar 13, 2024 · 6 comments

Comments

@Swaraj2004
Copy link

Hi there, I am using the MultipleSelector component and I have followed exact steps of installation as shown on the website.
I am not able to select the options using mouse like shown on the website but the options are selectable using keyboard.
I want to use mouse click to select the options.

options

Am I missing something? Please help.

@benmarg
Copy link

benmarg commented Mar 13, 2024

I'm also having this issue when trying to use the Form version of the MultiSelector with the ShadCN form. Let me know if you'd like a link to the repo. Shouldn't be necessary, it's just a straight rip of the form implementation from the website. @hsuanyi-chou

@hsuanyi-chou
Copy link
Owner

hsuanyi-chou commented Mar 13, 2024

What’s your cmdk version?
Trying to downgrade to 0.2.1.
I ran into the same issue recently. Only using Command in shadcn.

I have not figured out how to fix it.
But downgrading to 0.2.1 works.

Looks like related to cmdk. I am still digging it.

@Swaraj2004
Copy link
Author

What’s your cmdk version? Trying to downgrade to 0.2.1. I ran into the same issue recently.

I have not figured out how to fix it. But downgrading to 0.2.1 works.

Yes, I had cmdk version 1.0.0.
And downgrading it to 0.2.1 worked.
Thank you.

@njdowdy
Copy link

njdowdy commented Mar 14, 2024

Saw this same issue today while trying to upgrade to cmdk 1.0.0!

This is a known issue: shadcn-ui/ui#2945

This may not make it in the final fix, but a short-term workaround is adjusting line 120 in shadcn's command.tsx to this:

"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-[selected='true']:bg-accent aria-[selected='true']:text-accent-foreground data-[disabled='true']:pointer-events-none data-[disabled='true']:opacity-50",

@alexanderwford
Copy link

Confirming that the fix mentioned above does fix the issue with clicking the items not adding them to the list.

@hsuanyi-chou
Copy link
Owner

hsuanyi-chou commented Mar 18, 2024

Thanks @njdowdy,
Confirmation is fixed as well.

Perhaps a better approach would be to wait for shadcn to update its Command component.

I update to the installation step of demo page so that people can fix it quickly.

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

5 participants