From 88eee1cb8c1b875a84816f66f51b88d34b2026f9 Mon Sep 17 00:00:00 2001 From: Et7f3 Date: Sat, 17 Feb 2024 19:24:53 +0000 Subject: [PATCH] BodyRows merge rowClassName properly #5983 --- components/lib/datatable/BodyRow.js | 6 +++--- components/lib/hooks/useMergeProps.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/lib/datatable/BodyRow.js b/components/lib/datatable/BodyRow.js index f189119c23..dc5044c39f 100644 --- a/components/lib/datatable/BodyRow.js +++ b/components/lib/datatable/BodyRow.js @@ -465,10 +465,11 @@ export const BodyRow = React.memo((props) => { const content = createContent(); const tabIndex = getTabIndex(); const rowProps = mergeProps( + getBodyRowPTOptions('bodyRow'), { role: 'row', tabIndex: tabIndex, - className: classNames(rowClassName, cx('bodyRow', { rowProps: props })), + className: classNames(cx('bodyRow', { rowProps: props }), rowClassName), style: style, onMouseDown: (e) => onMouseDown(e), onMouseUp: (e) => onMouseUp(e), @@ -490,8 +491,7 @@ export const BodyRow = React.memo((props) => { 'data-p-selectable-row': props.allowRowSelection && props.isSelectable({ data: props.rowData, index: props.rowIndex }), 'data-p-highlight': props.selected, 'data-p-highlight-contextmenu': props.contextMenuSelected - }, - getBodyRowPTOptions('bodyRow') + } ); return {content}; diff --git a/components/lib/hooks/useMergeProps.js b/components/lib/hooks/useMergeProps.js index 59865247f5..d4535d001d 100644 --- a/components/lib/hooks/useMergeProps.js +++ b/components/lib/hooks/useMergeProps.js @@ -10,7 +10,7 @@ export const useMergeProps = () => { return (...props) => { const options = { - ...(context?.ptOptions?.classNameMergeFunction && { classNameMergeFunction: context.classNameMergeFunction }) + ...(context?.ptOptions?.classNameMergeFunction && { classNameMergeFunction: context.ptOptions.classNameMergeFunction }) }; return _mergeProps(props, options);