MCPcopy Index your code
hub / github.com/adobe/react-spectrum / getRows

Method getRows

packages/@react-aria/test-utils/src/table.ts:545–553  ·  view source on GitHub ↗

* Returns the rows within the table if any. Can be filtered to a specific row group if provided * via `element`.

(opts: {element?: HTMLElement} = {})

Source from the content-addressed store, hash-verified

543 * via `element`.
544 */
545 getRows(opts: {element?: HTMLElement} = {}): HTMLElement[] {
546 let {element} = opts;
547 if (element != null) {
548 return within(element).queryAllByRole('row');
549 }
550 return this.getRowGroups()
551 .slice(1)
552 .flatMap(rowGroup => within(rowGroup).queryAllByRole('row'));
553 }
554
555 /**
556 * Returns the currently selected rows within the table if any.

Callers 3

keyboardNavigateToRowMethod · 0.95
findRowMethod · 0.95
getSelectedRowsMethod · 0.95

Calls 2

getRowGroupsMethod · 0.95
sliceMethod · 0.80

Tested by

no test coverage detected