(props)
| 424 | |
| 425 | describe('pointerDragSource', () => { |
| 426 | function DraggableTable(props) { |
| 427 | let {dragAndDropHooks} = useDragAndDrop({ |
| 428 | getItems: keys => [...keys].map(key => ({'text/plain': `${key}`})), |
| 429 | pointerDragSource: props.pointerDragSource |
| 430 | }); |
| 431 | return ( |
| 432 | <TableView aria-label="Draggable table" dragAndDropHooks={dragAndDropHooks}> |
| 433 | <TableHeader> |
| 434 | <Column isRowHeader>Name</Column> |
| 435 | <Column>Notes</Column> |
| 436 | </TableHeader> |
| 437 | <TableBody> |
| 438 | <Row id="1" textValue="Foo 1"> |
| 439 | <Cell>Foo 1</Cell> |
| 440 | <Cell> |
| 441 | <input type="text" aria-label="Foo 1 notes" /> |
| 442 | </Cell> |
| 443 | </Row> |
| 444 | <Row id="2" textValue="Foo 2"> |
| 445 | <Cell>Foo 2</Cell> |
| 446 | <Cell> |
| 447 | <input type="text" aria-label="Foo 2 notes" /> |
| 448 | </Cell> |
| 449 | </Row> |
| 450 | </TableBody> |
| 451 | </TableView> |
| 452 | ); |
| 453 | } |
| 454 | |
| 455 | it('should make the row draggable and visually hide the drag button by default', () => { |
| 456 | let {getAllByRole} = render(<DraggableTable />); |
nothing calls this directly
no test coverage detected