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

fix: Combobox examples #3506

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

marctorrelles
Copy link

As explained in the new Docummentation of cmdk as well as in this issue, the Command set of components now need the CommandList component to be wrapped inside the options.

This PR fixes the documentation and examples where it is being used.

Copy link

vercel bot commented Apr 16, 2024

@marctorrelles is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

@tresorama
Copy link

Also components/ui/command needs a little CSS update due to 1.0.0. release of cmdk.
Open Release Note and look for Update [aria-disabled] and [aria-selected] CSS selectors section.

The update is this

// components/ui/command.tsx

const CommandItem = React.forwardRef<
  React.ElementRef<typeof CommandPrimitive.Item>,
  React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>
>(({ className, ...props }, ref) => (
  <CommandPrimitive.Item
    ref={ref}
    className={cn(
      "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground 
- data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
+ data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50", 
      className
    )}
    {...props}
  />
));

@marctorrelles
Copy link
Author

Thanks @tresorama! I already did the changes here and there. I omitted the json files as I guess they are auto-generated, such as this one.

Also, I took the freedom to update the cmdk version in the package.json.

Let me know if there's anything else to do from my side!

@tresorama
Copy link

Thanks @tresorama! I already did the changes here and there. I omitted the json files as I guess they are auto-generated, such as this one.

Also, I took the freedom to update the cmdk version in the package.json.

Let me know if there's anything else to do from my side!

Great job!
Unfortunately I'm not the right person to lead this PR because i've started using shadcn and cmdk yesterday and I have missing knowledge.
I was creating a Combobox autocomplete and errors fixing brought me here!

I kindly include people and issue that can help this PR succeed!

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

Successfully merging this pull request may close these issues.

None yet

2 participants