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]: Combobox search functionality searches values instead of labels #5352

Open
2 tasks done
tbeckett1211 opened this issue Oct 12, 2024 · 4 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@tbeckett1211
Copy link

Describe the bug

The example on the web page works fine but that is because the values have the same text as the labels. Most selects will have a description as the label and some sort of ID as the value. Upon changing the values to in the examples to random strings, the search/filter does not filter based on the labels, it searches based upon the value.

Affected component/components

combobox

How to reproduce

Change values of frameworks to values that does not directly contain the same text as the labels. Then try to search for a framework in the list

Codesandbox/StackBlitz link

No response

Logs

No response

System Info

Chrome

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues
@tbeckett1211 tbeckett1211 added the bug Something isn't working label Oct 12, 2024
@karanBRAVO
Copy link

Hey @tbeckett1211, I would like to fix this issue. Assign it to me.

@tbeckett1211
Copy link
Author

@karanBRAVO I have no idea how to do that, however, I would really appreciate a patch for this.

@karanBRAVO
Copy link

🤩⏳ I have started working on this issue.

@BrendanC23
Copy link

Take a look at this cmdk PR. [email protected] adds a new keywords option. This Shadcn PR implements this.

Alternatively, you can write a custom filter function. See the cmdk docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants
@BrendanC23 @karanBRAVO @tbeckett1211 and others