Skip to content

Commit 607458b

Browse files
authored
fix(AnalyticalTable): don't add rowindex to element attributes (#4723)
1 parent f58b103 commit 607458b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/main/src/components/AnalyticalTable/TableBody/VirtualTableBody.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export const VirtualTableBody = (props: VirtualTableBodyProps) => {
157157
lastNonEmptyRow.current = row;
158158
}
159159
prepareRow(row);
160-
const rowProps = row.getRowProps({ rowIndex: virtualRow.index });
160+
const rowProps = row.getRowProps({ 'aria-rowindex': virtualRow.index });
161161
const isNavigatedCell = markNavigatedRow(row);
162162
const RowSubComponent = typeof renderRowSubComponent === 'function' ? renderRowSubComponent(row) : undefined;
163163

@@ -192,7 +192,7 @@ export const VirtualTableBody = (props: VirtualTableBodyProps) => {
192192
ref={(node) => {
193193
virtualRow.measureElement(node);
194194
}}
195-
aria-rowindex={virtualRow.index + 1}
195+
aria-rowindex={rowProps['aria-rowindex'] + 1}
196196
>
197197
{RowSubComponent && (row.isExpanded || alwaysShowSubComponent) && (
198198
<SubComponent

packages/main/src/components/AnalyticalTable/hooks/useStyling.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const getRowProps = (rowProps, { instance, row, userProps }) => {
5858
) {
5959
className += ` ${classes.tableGroupHeader}`;
6060
}
61-
if (alternateRowColor && userProps.rowIndex % 2 !== 0) {
61+
if (alternateRowColor && userProps['aria-rowindex'] % 2 !== 0) {
6262
className += ` ${classes.alternateRowColor}`;
6363
}
6464

0 commit comments

Comments
 (0)