-
-
Notifications
You must be signed in to change notification settings - Fork 20.9k
fix(#1003): add missing cursor: pointer to interactive ui elements #1059
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -17,7 +17,7 @@ interface CategoryItemProps { | |||||||||||||||||
|
|
||||||||||||||||||
| export function CategoryItem({ category, isSubscribed, showSubscribe }: CategoryItemProps) { | ||||||||||||||||||
| return ( | ||||||||||||||||||
| <div className="group flex items-center justify-between gap-2 border rounded-[var(--radius)] px-3 py-2 bg-card hover:bg-accent/50 transition-colors"> | ||||||||||||||||||
| <div className="group flex cursor-pointer items-center justify-between gap-2 border rounded-[var(--radius)] px-3 py-2 bg-card hover:bg-accent/50 transition-colors"> | ||||||||||||||||||
| <Link | ||||||||||||||||||
| href={`/categories/${category.slug}`} | ||||||||||||||||||
| className="flex items-center gap-2 min-w-0 flex-1" | ||||||||||||||||||
|
Comment on lines
+20
to
23
|
||||||||||||||||||
| <div className="group flex cursor-pointer items-center justify-between gap-2 border rounded-[var(--radius)] px-3 py-2 bg-card hover:bg-accent/50 transition-colors"> | |
| <Link | |
| href={`/categories/${category.slug}`} | |
| className="flex items-center gap-2 min-w-0 flex-1" | |
| <div className="group flex items-center justify-between gap-2 border rounded-[var(--radius)] px-3 py-2 bg-card hover:bg-accent/50 transition-colors"> | |
| <Link | |
| href={`/categories/${category.slug}`} | |
| className="flex items-center gap-2 min-w-0 flex-1 cursor-pointer" |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -5,7 +5,7 @@ import { cva, type VariantProps } from "class-variance-authority" | |||||
| import { cn } from "@/lib/utils" | ||||||
|
|
||||||
| const badgeVariants = cva( | ||||||
| "inline-flex items-center justify-center rounded-[var(--radius)] border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none transition-colors overflow-hidden", | ||||||
| "inline-flex items-center cursor-pointer justify-center rounded-[var(--radius)] border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none transition-colors overflow-hidden", | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep the pointer cursor opt-in for
Suggested fix- "inline-flex items-center cursor-pointer justify-center rounded-[var(--radius)] border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none transition-colors overflow-hidden",
+ "inline-flex items-center justify-center rounded-[var(--radius)] border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none transition-colors overflow-hidden",📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| { | ||||||
|
Comment on lines
7
to
9
|
||||||
| variants: { | ||||||
| variant: { | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -109,7 +109,7 @@ function SelectItem({ | |
| <SelectPrimitive.Item | ||
| data-slot="select-item" | ||
| className={cn( | ||
| "focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", | ||
| "focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-pointer items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The main select control still won't show a pointer. These updates only affect the opened menu. The element users actually hover before opening a select is Suggested fix function SelectTrigger({
className,
size = "default",
children,
...props
}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
size?: "sm" | "default"
}) {
return (
<SelectPrimitive.Trigger
data-slot="select-trigger"
data-size={size}
className={cn(
- "border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
+ "border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit cursor-pointer items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
className
)}
{...props}
>Also applies to: 148-148, 166-166 🤖 Prompt for AI Agents |
||
| className | ||
| )} | ||
|
Comment on lines
109
to
114
|
||
| {...props} | ||
|
|
@@ -145,7 +145,7 @@ function SelectScrollUpButton({ | |
| <SelectPrimitive.ScrollUpButton | ||
| data-slot="select-scroll-up-button" | ||
| className={cn( | ||
| "flex cursor-default items-center justify-center py-1", | ||
| "flex cursor-pointer items-center justify-center py-1", | ||
| className | ||
| )} | ||
| {...props} | ||
|
|
@@ -163,7 +163,7 @@ function SelectScrollDownButton({ | |
| <SelectPrimitive.ScrollDownButton | ||
| data-slot="select-scroll-down-button" | ||
| className={cn( | ||
| "flex cursor-default items-center justify-center py-1", | ||
| "flex cursor-pointer items-center justify-center py-1", | ||
| className | ||
| )} | ||
| {...props} | ||
|
|
||
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.
Don't put
cursor-pointeron the non-clickable wrapper.Only the
LinkandSubscribeButtonare actionable here. With this change, the row shows a pointer over dead space and the count block, which misrepresents what users can click.Suggested fix
🤖 Prompt for AI Agents