-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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: Command/Combobox TypeError and Unclickable/Disabled items + Documentation #2945
fix: Command/Combobox TypeError and Unclickable/Disabled items + Documentation #2945
Conversation
@jhnguyen521 is attempting to deploy a commit to the shadcn-pro Team on Vercel. A member of the Team first needs to authorize it. |
This PR handles the proper styling via data attributes + dependancy bump + update registry. |
609bd50
to
0eb6e40
Compare
Fixed crlf line endings to lf. May be worth documenting this in contributing, but pnpm seems to output files with \r\n instead of just \r on windows machines, ignoring tsconfig compiler options |
The component specific issues have already been fixed in #2626 🤔 |
After you later added the bug fix from this and the other issue afterwards in a later commit, then yes if that counts as "already" :) Also, aria is already set in cmdk and we can be relatively certain that will always be there for accessibility reasons, not sure how opinionated we should be about using their aria/data attribute. Personally, I think it's fine to leave as is but what do I know. Also, this PR updates necessary documentation to handle other breaking changes in cmdk. |
Happy to do a version bump in this PR as well. |
I am not too sure why you are hinting that I have "copied" your work or something? With all due respect, the original #2626 PR was opened in January as a follow up from #1980 that was opened in November 2023. I have been monitoring this via an issue opened in the After my initial comment on this PR, I noticed that you made some extra commits, specifically, extra changes that were made in #2626 that had not been made in this PR. I see that these commits have now been wiped out as you cleaned the commit history... You also commented on my PR which you have since deleted...I don't understand
Here is the commit you speak of...430c1b3 |
Yes, the change I made were applying the bug fix to the aria-selected attributes, which is the purpose of this PR? (which I might add, was also discussed and brought to my attention by someone else in #2944, so not sure what you are trying to re-imply? lol) Whereas your PR was originally just changing aria-selected -> data-selected and doing a version bump.
My comment was on being opinionated about aria-selected vs data-selected, but I realized that I was incorrect about some assumptions I was saying that made my comment irrelevant so I just deleted it :) All I'm saying is that, it's not very cool to come in saying "already been fixed here 🤔", after applying a fix that wasn't there in the original commit an doesn't have any changes around the documentation for this component, when the purposes of our PRs are different, especially when I've been discussing with others in #2944 to workaround the issue. Either way, I was initially annoyed, but if maintainers just want to use the earlier commit, happy to close mine and you can merge in the doc changes or I just make another PR with that. 🤷 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For many components which are not from cmdk the applied changes do not work and cause the disable state to not work anymore.
Means the fix: data-[disabled='true'] does not work for all components.
Good catch, thanks! I'll probably just revert changes to all other components since I'd probably have to make a custom class in css to get this to work for all while still being in the classNames. Should make for a simpler PR as well. |
Thank you for the fix! |
Same Issue on the Example Filter Function, that dont works anymore too. |
Thanks for the fix! |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -117,7 +117,7 @@ const CommandItem = React.forwardRef< | |||
<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 data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50", | |||
"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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use the new data-selected attribute instead if aria? Thank you.
…yen521/ui into fix-handling-data-disabled # Conflicts: # apps/www/app/(app)/examples/playground/components/model-selector.tsx
6e71912
to
3770145
Compare
Any updates on this? |
WE NEED THIS !!! |
@kevinmitch14 I merged #2626. Anything else we're missing? \cc @jhnguyen521 |
# Conflicts: # apps/www/app/(app)/examples/forms/account/account-form.tsx # apps/www/app/(app)/examples/playground/components/model-selector.tsx # apps/www/content/docs/components/combobox.mdx # apps/www/public/registry/styles/default/command.json # apps/www/public/registry/styles/new-york/command.json # apps/www/registry/default/ui/command.tsx # apps/www/registry/new-york/ui/command.tsx
@kevinmitch14 Thanks. On it. |
* fix: fix breaking changes for Command component that comes with cmdk 1.0.0 * chore: build registry * chore: moving paths for some examples * chore: moving paths for some examples * chore: use data instead of aria * fix: update command and pin cmdk * fix: model selector * fix: command for new york --------- Co-authored-by: shadcn <m@shadcn.com>
* fix: fix breaking changes for Command component that comes with cmdk 1.0.0 * chore: build registry * chore: moving paths for some examples * chore: moving paths for some examples * chore: use data instead of aria * fix: update command and pin cmdk * fix: model selector * fix: command for new york --------- Co-authored-by: shadcn <m@shadcn.com>
* fix: fix breaking changes for Command component that comes with cmdk 1.0.0 * chore: build registry * chore: moving paths for some examples * chore: moving paths for some examples * chore: use data instead of aria * fix: update command and pin cmdk * fix: model selector * fix: command for new york --------- Co-authored-by: shadcn <m@shadcn.com>
Fixes #2944 due to latest cmdk update with breaking changes for the Command component. Until this fix is merged, all new command components that install cmdk@1.00 will be broken and items will not be selectable. People who also have existing components and update to cmdk 1.00 and don’t have a
<CommandList>
will experience crashes upon opening up the component. See issue above for more details.^ Happy to not do this for all other components, but I figure it's better to just do this preventatively if it's backwards compatible. Either way, things will break for data-disabled="false" for all existing
data-[disabled]