MCPcopy Create free account
hub / github.com/adobe/react-spectrum / DraggableTable

Function DraggableTable

packages/@react-spectrum/s2/test/TableView.test.tsx:426–453  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

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 />);

Callers

nothing calls this directly

Calls 1

useDragAndDropFunction · 0.90

Tested by

no test coverage detected