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

Function getAllRows

packages/react-aria-components/test/Tree.test.tsx:1229–1234  ·  view source on GitHub ↗
(tree: HTMLElement)

Source from the content-addressed store, hash-verified

1227 const TreeExample = comp === 'DynamicSectionTree' ? DynamicSectionTree : DynamicTree;
1228
1229 function getAllRows(tree: HTMLElement) {
1230 const rowGroups = within(tree).queryAllByRole('rowgroup');
1231 return rowGroups.length > 0
1232 ? rowGroups.flatMap(rowGroup => within(rowGroup).queryAllByRole('row').slice(1))
1233 : within(tree).queryAllByRole('row');
1234 }
1235
1236 it('left and right arrows should navigate between interactive elements in the row', async () => {
1237 let {getByRole} = render(<TreeExample treeProps={{selectionMode: 'multiple'}} />);

Callers 1

Tree.test.tsxFile · 0.85

Calls 1

sliceMethod · 0.80

Tested by

no test coverage detected