shadcn-ui / ui

Beautifully designed components that you can copy and paste into your apps. Accessible. Customizable. Open Source.
https://ui.shadcn.com
MIT License
62.96k stars 3.54k forks source link

[bug]: Error in documentation of combobox #3757

Open Invito101 opened 1 month ago

Invito101 commented 1 month ago

Describe the bug

There's an error in the documentation of Combobox ( https://ui.shadcn.com/docs/components/combobox ). The components after the CommandInput needs to wrapped around CommandList according to the Command docs ( https://ui.shadcn.com/docs/components/command ).

shadcnerror

Affected component/components

Combobox

How to reproduce

  1. Go to the code for the examples given in the Combobox docs ( https://ui.shadcn.com/docs/components/combobox )
  2. Running that code as a component gives an error.

Codesandbox/StackBlitz link

https://ui.shadcn.com/docs/components/combobox#combobox

Logs

No response

System Info

none

Before submitting

TanishqSharma2022 commented 1 month ago

I will be fixing this. Not a bug, its just a typo ig.

Invito101 commented 1 month ago

I will be fixing this. Not a bug, its just a typo ig.

I initially marked it as a bug instead of a typo because it's not just a simple spelling mistake, it causes an error that is quite complex to debug, especially for newbies like me. However, if it's not a significant issue, I will use the 'typo' label instead in the future.

lucasfarias2 commented 1 month ago

Quick fix for this: Just wrap your <CommandEmpty> and <CommandGroup> with <CommandList>

Invito101 commented 1 month ago

Quick fix for this: Just wrap your <CommandEmpty> and <CommandGroup> with <CommandList>

Yes, I just reported so that the documentation can be fixed.

gajakannan commented 1 month ago

I was banging my head for 3 days on this particular issue, tried several different things, and for a newbie, as @Invito101 said not easy to find out what is causing this issue until I decided to look at the issue log. was such a simple fix. I agree this needs to be updated in the document, otherwise people like me almost would have given up on combobox and used something else just because we couldnt get to this...