Open JollyBolt opened 3 months ago
I just set the height of wherever I'm using the Checkbox as the height of the Checkbox.
Using the Shadcn example for Row Selection:
header: ({ table }) => (
<Checkbox
className="flex h-4 w-4"
checked={
table.getIsAllPageRowsSelected() ||
(table.getIsSomePageRowsSelected() && "indeterminate")
}
onCheckedChange={(value) => table.toggleAllPageRowsSelected(!!value)}
aria-label="Select all"
/>
),
cell: ({ row }) => (
<Checkbox
className="flex h-4 w-4"
checked={row.getIsSelected()}
onCheckedChange={(value) => row.toggleSelected(!!value)}
aria-label="Select row"
/>
I think this also resolves the issue across browsers. However the sizing of the checkmark itself slightly increases, but you can try to change that in the component itself to fix that.
Describe the bug
Issue
On checking the
CheckBox
component in theData Table
, the height of rows increases.My Solution
The
Checkbox
component contains the following code:Changing the following line
to
fixes the issue.
I don't know if this solution messes up the implementation of
Checkbox
in any other case. If this seems an acceptable solution, I would like to be assigned this issue. I would create a PR with the above-mentioned solution.Affected component/components
Data Table
How to reproduce
Implement the demo table on https://ui.shadcn.com/docs/components/data-table. OR Check out the StackBlitz link provided.
Codesandbox/StackBlitz link
https://stackblitz.com/edit/stackblitz-starters-rx7yav?file=app%2Fpage.tsx
Logs
No response
System Info
Before submitting