diff --git a/packages/@react-spectrum/table/src/TableViewBase.tsx b/packages/@react-spectrum/table/src/TableViewBase.tsx index fd0585da8ee..65d1278cc51 100644 --- a/packages/@react-spectrum/table/src/TableViewBase.tsx +++ b/packages/@react-spectrum/table/src/TableViewBase.tsx @@ -291,7 +291,11 @@ function TableViewBase(props: TableBaseProps, ref: DOMRef + parent={parent?.layoutInfo} + // Override the default role="rowgroup" with role="presentation", + // in favor or adding role="rowgroup" to the ScrollView with + // ref={bodyRef} in the TableVirtualizer below. + role="presentation"> {renderChildren(children)} ); @@ -332,7 +336,7 @@ function TableViewBase(props: TableBaseProps, ref: DOMRef ); } - + return ( (props: TableBaseProps, ref: DOMRef(props: TableBaseProps, ref: DOMRef { ); let body = tree.getAllByRole('rowgroup')[1]; - let scrollView = body.parentNode.parentNode; + let scrollView = body; let rows = within(body).getAllByRole('row'); expect(rows).toHaveLength(34); // each row is 41px tall. table is 1000px tall. 25 rows fit. + 1/3 overscan