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

Method findRow

packages/@react-aria/test-utils/src/tree.ts:61–72  ·  view source on GitHub ↗

* Returns a row matching the specified index or text content.

(opts: {indexOrText: number | string})

Source from the content-addressed store, hash-verified

59 * Returns a row matching the specified index or text content.
60 */
61 findRow(opts: {indexOrText: number | string}): HTMLElement {
62 let {indexOrText} = opts;
63
64 let row;
65 if (typeof indexOrText === 'number') {
66 row = this.getRows()[indexOrText];
67 } else if (typeof indexOrText === 'string') {
68 row = within(this.getTree()!).getByText(indexOrText).closest('[role=row]')! as HTMLElement;
69 }
70
71 return row;
72 }
73
74 private async keyboardNavigateToRow(opts: {
75 row: HTMLElement;

Callers 5

toggleRowSelectionMethod · 0.95
toggleRowExpansionMethod · 0.95
triggerRowActionMethod · 0.95

Calls 2

getRowsMethod · 0.95
getTreeMethod · 0.95

Tested by

no test coverage detected