From fd7a10e902485216b4f428ebe13b14ff5135b960 Mon Sep 17 00:00:00 2001 From: melloware Date: Fri, 3 Jan 2025 13:25:50 -0500 Subject: [PATCH] Fix #7513: TreeTable stripedRows fix --- components/lib/treetable/TreeTableBase.js | 2 +- components/lib/treetable/TreeTableRow.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/lib/treetable/TreeTableBase.js b/components/lib/treetable/TreeTableBase.js index 666971a7c8..912164cd3f 100644 --- a/components/lib/treetable/TreeTableBase.js +++ b/components/lib/treetable/TreeTableBase.js @@ -190,7 +190,7 @@ const classes = { row: ({ isSelected, rowProps: props }) => ({ 'p-highlight': isSelected(), 'p-highlight-contextmenu': props.contextMenuSelectionKey && props.contextMenuSelectionKey === props.node.key, - 'p-row-odd': props.rowIndex % 2 !== 0 + 'p-row-odd': parseInt(String(props.rowIndex).split('_').pop(), 10) % 2 !== 0 }), rowCheckbox: ({ partialChecked }) => classNames('p-treetable-checkbox', { 'p-indeterminate': partialChecked }), rowToggler: 'p-treetable-toggler p-link p-unselectable-text', diff --git a/components/lib/treetable/TreeTableRow.js b/components/lib/treetable/TreeTableRow.js index 96172edd76..6f7e81c669 100644 --- a/components/lib/treetable/TreeTableRow.js +++ b/components/lib/treetable/TreeTableRow.js @@ -1,5 +1,6 @@ import * as React from 'react'; import { ariaLabel } from '../api/Api'; +import { Checkbox } from '../checkbox/Checkbox'; import { ColumnBase } from '../column/ColumnBase'; import { useMergeProps } from '../hooks/Hooks'; import { CheckIcon } from '../icons/check'; @@ -9,7 +10,6 @@ import { MinusIcon } from '../icons/minus'; import { Ripple } from '../ripple/Ripple'; import { classNames, DomHandler, IconUtils, ObjectUtils } from '../utils/Utils'; import { TreeTableBodyCell } from './TreeTableBodyCell'; -import { Checkbox } from '../checkbox/Checkbox'; export const TreeTableRow = React.memo((props) => { const elementRef = React.useRef(null);