Skip to content

Commit f95ea64

Browse files
fix(badge): pin cursor: default so badges don't inherit pointer
A Badge is non-interactive but renders a <div> with no cursor, so it inherited cursor: pointer from clickable ancestors (e.g. a DataTable row with onClickRow). Add astw:cursor-default to badgeVariants so a badge never signals clickability. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 0b5b9be commit f95ea64

2 files changed

Lines changed: 14 additions & 7 deletions

File tree

.changeset/button-cursor-pointer.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,16 @@
22
"@tailor-platform/app-shell": patch
33
---
44

5-
Restore pointer cursor on `Button`. Tailwind v4 dropped the Preflight rule that
6-
gave `button`/`[role="button"]` a `cursor: pointer`, so the base `Button` showed
7-
the default arrow cursor while components that hardcode `astw:cursor-pointer`
8-
(e.g. `ActionPanel`) did not. Added `astw:cursor-pointer` to the `buttonVariants`
9-
base classes so all `Button` instances are consistent. Disabled buttons keep the
10-
default cursor via the existing `astw:disabled:pointer-events-none`.
5+
Fix cursor consistency across `Button` and `Badge`:
6+
7+
- **`Button`**: restore the pointer cursor. Tailwind v4 dropped the Preflight
8+
rule that gave `button`/`[role="button"]` a `cursor: pointer`, so the base
9+
`Button` showed the default arrow cursor while components that hardcode
10+
`astw:cursor-pointer` (e.g. `ActionPanel`) did not. Added `astw:cursor-pointer`
11+
to the `buttonVariants` base classes so all `Button` instances are consistent.
12+
Disabled buttons keep the default cursor via the existing
13+
`astw:disabled:pointer-events-none`.
14+
- **`Badge`**: pin `astw:cursor-default`. A `Badge` is non-interactive but
15+
renders a `<div>` with no cursor of its own, so it inherited `cursor: pointer`
16+
from clickable ancestors (e.g. a `DataTable` row with `onClickRow`). Explicitly
17+
setting the default cursor stops a badge from signalling clickability.

packages/core/src/components/badge.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { cva, type VariantProps } from "class-variance-authority";
33
import { cn } from "../lib/utils";
44

55
const badgeVariants = cva(
6-
"astw:inline-flex astw:items-center astw:rounded-md astw:border astw:px-2 astw:py-0.5 astw:text-xs astw:font-medium astw:transition-colors astw:focus:outline-none astw:focus:ring-2 astw:focus:ring-ring astw:focus:ring-offset-2",
6+
"astw:inline-flex astw:cursor-default astw:items-center astw:rounded-md astw:border astw:px-2 astw:py-0.5 astw:text-xs astw:font-medium astw:transition-colors astw:focus:outline-none astw:focus:ring-2 astw:focus:ring-ring astw:focus:ring-offset-2",
77
{
88
variants: {
99
variant: {

0 commit comments

Comments
 (0)