Skip to content

fix(styles): use data-[selected=true] variant for command items#11152

Open
ChihebBENCHEIKH1 wants to merge 1 commit into
shadcn-ui:mainfrom
ChihebBENCHEIKH1:fix/tailwind-v4-command-data-selected
Open

fix(styles): use data-[selected=true] variant for command items#11152
ChihebBENCHEIKH1 wants to merge 1 commit into
shadcn-ui:mainfrom
ChihebBENCHEIKH1:fix/tailwind-v4-command-data-selected

Conversation

@ChihebBENCHEIKH1

Copy link
Copy Markdown

Closes #11101

The 18 style variants under apps/v4/styles/*/ui/command.tsx use the data-selected: Tailwind variant, which doesn't reliably apply to cmdk's selected state — data-selected:bg-muted and data-selected:text-foreground never take effect, so the selected item has no visual highlight.

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 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 two ui-rtl/ variants).

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
@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown
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.

@github-actions

Copy link
Copy Markdown
Contributor

Can you sign the commits please? See https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits. Thank you.

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.

[bug]: data-selected:* variant is incorrect for Tailwind v4 Command component

1 participant