The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
fix nested button bug
Steven Tey7959b95fb882
diff --git a/packages/ui/src/table/selection-toolbar.tsx b/packages/ui/src/table/selection-toolbar.tsxindex 1a05505142..1811b90f65 100644--- a/packages/ui/src/table/selection-toolbar.tsx+++ b/packages/ui/src/table/selection-toolbar.tsx@@ -40,8 +40,7 @@ export function SelectionToolbar<T>({><div className="flex h-11 items-center py-2.5 pr-2"><div className="relative flex h-full w-12 shrink-0 items-center justify-center">- <button- type="button"+ <divclassName="absolute inset-0 flex items-center justify-center"onClick={(e) => {e.stopPropagation();@@ -59,7 +58,7 @@ export function SelectionToolbar<T>({: false}/>- </button>+ </div></div><div className="flex min-w-0 items-center gap-2.5 pl-1"><spandiff --git a/packages/ui/src/table/table.tsx b/packages/ui/src/table/table.tsxindex 0c0476ecfe..8711364c15 100644--- a/packages/ui/src/table/table.tsx+++ b/packages/ui/src/table/table.tsx@@ -156,8 +156,7 @@ export function useTable<T extends any>(size: SELECT_COLUMN_WIDTH,maxSize: SELECT_COLUMN_WIDTH,header: ({ table }: { table: TableType<T> }) => (- <button- type="button"+ <divclassName="flex size-full items-center justify-center"onClick={(e) => {e.stopPropagation();@@ -175,10 +174,10 @@ export function useTable<T extends any>(: false}/>- </button>+ </div>),cell: ({ row, table }: { row: Row<T>; table: TableType<T> }) => {- const onSelectRow = (e: MouseEvent<HTMLButtonElement>) => {+ const onSelectRow = (e: MouseEvent<HTMLElement>) => {e.stopPropagation();const currentId = getRowId?.(row.original);const rows = table.getRowModel().rows;@@ -243,11 +242,12 @@ export function useTable<T extends any>(const canSelect = row.getCanSelect();return (- <button- type="button"- className="flex size-full items-center justify-center disabled:cursor-not-allowed"- onClick={onSelectRow}- disabled={!canSelect}+ <div+ className={cn(+ "flex size-full items-center justify-center",+ !canSelect && "cursor-not-allowed",+ )}+ onClick={canSelect ? onSelectRow : undefined}title="Select"><Checkbox@@ -255,7 +255,7 @@ export function useTable<T extends any>(checked={row.getIsSelected()}disabled={!canSelect}/>- </button>+ </div>);},},