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

[bug]: Command Items fail to receive pointer events even when not disabled #4192

Open
2 tasks done
ceptoplex opened this issue Jul 6, 2024 · 4 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@ceptoplex
Copy link

ceptoplex commented Jul 6, 2024

Describe the bug

With the recent changes coming in from #4181, the CSS classes specified for CommandPrimitive.Item have changed:

"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",

The problematic change is going from

data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50

to

data-[disabled]:pointer-events-none data-[disabled]:opacity-50

which is not picked up correctly for me in Chrome Version 126.0.6478.127 (arm64) on MacOS.
I haven't looked through the rest of the PR but the name suggests it focuses on Charts, so seeing such changes included to the Command, I think there is a risk of similar changes/issues in other parts as well.

Affected component/components

Command (i.e., Command, Combobox, etc.)

How to reproduce

  1. Include any Command demo (e.g. Command, Combobox), and do not disable Command Items

Expected: Command Items should be selectable with a cursor
Actual: Command Items items are always greyed out and no longer selectable with a cursor

Codesandbox/StackBlitz link

No response

Logs

No response

System Info

Google Chrome 126.0.6478.127 (arm64)
macOS 14.5

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues
@ceptoplex ceptoplex added the bug Something isn't working label Jul 6, 2024
@aaronfulkerson
Copy link

Having the same issue.

@freakyflow
Copy link

freakyflow commented Jul 12, 2024

Having the same issue. Reverting this change helps.
I don't think it's a chrome problem though because chrome handles this as expected:
data-[disabled=true]: only triggers when disabled is set to true
data-[disabled]: triggers if disabled is set to any value

For some reason the intention was to just check if the data-disabled attribute is set at all, ignoring its value.

@jqjjian
Copy link

jqjjian commented Jul 20, 2024

I don't know why I modified the corresponding class according to the appeal method to work normally.

@Mecil9
Copy link

Mecil9 commented Jul 24, 2024

i have the same issue.
when use command components like this way:
image
web page response: disable components, mouse hover isn't work.
image
remove ui/command.tsx code:
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50"
it's working!
image

dependencies list:
"tailwindcss": "^3.4.1",
"cmdk": "^1.0.0",
"@radix-ui/react-alert-dialog": "^1.1.1",
"@radix-ui/react-aspect-ratio": "^1.1.0",
"@radix-ui/react-dialog": "^1.1.1",
"@radix-ui/react-dropdown-menu": "^2.1.1",
"@radix-ui/react-label": "^2.1.0",
"@radix-ui/react-popover": "^1.1.1",
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-switch": "^1.1.0",
"@radix-ui/react-toast": "^1.2.1",

StevePhuc added a commit to alteropen-com/alteropen that referenced this issue Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants