(props: {pointerDragSource?: 'item' | 'handle'})
| 596 | |
| 597 | describe('pointerDragSource', () => { |
| 598 | function DraggableTree(props: {pointerDragSource?: 'item' | 'handle'}) { |
| 599 | let {dragAndDropHooks} = useDragAndDrop({ |
| 600 | getItems: keys => [...keys].map(key => ({'text/plain': `${key}`})), |
| 601 | pointerDragSource: props.pointerDragSource |
| 602 | }); |
| 603 | return ( |
| 604 | <TreeView aria-label="Draggable tree" dragAndDropHooks={dragAndDropHooks}> |
| 605 | <TreeViewItem id="projects" textValue="Projects"> |
| 606 | <TreeViewItemContent> |
| 607 | <Text>Projects</Text> |
| 608 | </TreeViewItemContent> |
| 609 | </TreeViewItem> |
| 610 | <TreeViewItem id="photos" textValue="Photos"> |
| 611 | <TreeViewItemContent> |
| 612 | <Text>Photos</Text> |
| 613 | </TreeViewItemContent> |
| 614 | </TreeViewItem> |
| 615 | </TreeView> |
| 616 | ); |
| 617 | } |
| 618 | |
| 619 | it('should make the row draggable and visually hide the drag button by default', () => { |
| 620 | let {getAllByRole} = render(<DraggableTree />); |
nothing calls this directly
no test coverage detected