fix(styles): use data-[selected=true] variant for command items#11152
Open
ChihebBENCHEIKH1 wants to merge 1 commit into
Open
fix(styles): use data-[selected=true] variant for command items#11152ChihebBENCHEIKH1 wants to merge 1 commit into
ChihebBENCHEIKH1 wants to merge 1 commit into
Conversation
The `data-selected:` Tailwind shorthand doesn't reliably apply to `cmdk`'s selected state across all 18 style variants. The registry's canonical `apps/v4/registry/new-york-v4/ui/command.tsx` already uses `data-[selected=true]:`, matching the exact attribute value cmdk emits on the selected item — this change brings the style variants in line with that. Closes shadcn-ui#11101
Contributor
|
Someone is attempting to deploy a commit to the shadcn-pro Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
|
Can you sign the commits please? See https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits. Thank you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #11101
The 18 style variants under
apps/v4/styles/*/ui/command.tsxuse thedata-selected:Tailwind variant, which doesn't reliably apply tocmdk's selected state —data-selected:bg-mutedanddata-selected:text-foregroundnever take effect, so the selected item has no visual highlight.The registry's canonical
apps/v4/registry/new-york-v4/ui/command.tsxalready usesdata-[selected=true]:, matching the exact attribute value cmdk emits on selection. This change brings the 18 style variants in line with that pattern:data-selected:→data-[selected=true]:group-data-selected/→group-data-[selected=true]/Same substitution applied uniformly across every
apps/v4/styles/*/ui/command.tsx(and the twoui-rtl/variants).