huntabyte / shadcn-svelte

shadcn/ui, but for Svelte. ✨
https://shadcn-svelte.com
MIT License
4.13k stars 259 forks source link

Combobox example in documentation shows wrong results #1041

Closed Flo0807 closed 1 month ago

Flo0807 commented 1 month ago

Change Type

Correction

Proposed Changes

The Form Combobox Example in the documentation (the last example on the page) shows languages to choose from. Each language has a value and a label. The label is displayed to the user in the list and the value is used internally when selecting and submitting languages.

The problem is that the value is used to determine search results. Since the values and labels are entirely different (e.g., {label: "German", value: "de" }), this results in displaying wrong results. For example, if I type "de" into the search bar, the result will be "German".

From a user perspective, this doesn't make sense because I want to search the languages by label, since that's the property I see in the list.

Showcase video below:

https://github.com/huntabyte/shadcn-svelte/assets/60519307/ca61be5f-32c1-4ba6-877b-0f739f768cfe

shyakadavis commented 1 month ago

Hi;

If this is not intentional (I'm pretty sure it's not), I'll go ahead and start working on a fix. 🙂