diff --git a/resources/js/components/sortable-grid.tsx b/resources/js/components/sortable-grid.tsx index cdb25f5f..383e3075 100644 --- a/resources/js/components/sortable-grid.tsx +++ b/resources/js/components/sortable-grid.tsx @@ -76,13 +76,16 @@ export function SortableGrid({ trigger('selection')} onDragEnd={handleDragEnd} >
{items.map((item) => ( - + trigger('selection')} + > {(dragHandle) => renderItem(item, dragHandle)} ))} @@ -95,9 +98,11 @@ export function SortableGrid({ function SortableItem({ id, + onActivate, children, }: { id: string; + onActivate: () => void; children: (dragHandle: ReactNode) => ReactNode; }) { const { @@ -118,6 +123,10 @@ function SortableItem({ className="cursor-grab touch-none text-muted-foreground transition-colors hover:text-foreground active:cursor-grabbing" {...attributes} {...listeners} + onPointerDown={(event) => { + onActivate(); + listeners?.onPointerDown?.(event); + }} >