Skip to content

Commit

Permalink
BodyRows merge rowClassName properly #5983 (#5995)
Browse files Browse the repository at this point in the history
  • Loading branch information
Et7f3 committed Feb 17, 2024
1 parent f69f689 commit a0567fb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions components/lib/datatable/BodyRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ export const BodyRow = React.memo((props) => {
{
role: 'row',
tabIndex: tabIndex,
className: classNames(rowClassName, cx('bodyRow', { rowProps: props })),
className: classNames(cx('bodyRow', { rowProps: props })),
style: style,
onMouseDown: (e) => onMouseDown(e),
onMouseUp: (e) => onMouseUp(e),
Expand All @@ -491,7 +491,10 @@ export const BodyRow = React.memo((props) => {
'data-p-highlight': props.selected,
'data-p-highlight-contextmenu': props.contextMenuSelected
},
getBodyRowPTOptions('bodyRow')
getBodyRowPTOptions('bodyRow'),
{
className: classNames(rowClassName)
}
);

return <tr {...rowProps}>{content}</tr>;
Expand Down
2 changes: 1 addition & 1 deletion components/lib/hooks/useMergeProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const useMergeProps = () => {

return (...props) => {
const options = {
...(context?.ptOptions?.classNameMergeFunction && { classNameMergeFunction: context.classNameMergeFunction })
classNameMergeFunction: context?.ptOptions?.classNameMergeFunction
};

return _mergeProps(props, options);
Expand Down

0 comments on commit a0567fb

Please sign in to comment.