Skip to content

Commit

Permalink
Merge pull request #6295 from primefaces/tree-checkbox
Browse files Browse the repository at this point in the history
Fix #6287 - Tree: Checkboxes use wrong color in the check mark.
  • Loading branch information
nitrogenous authored Apr 3, 2024
2 parents b3dcc8a + 31b5a9a commit b03ec0f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/lib/tree/TreeBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const classes = {
nodeIcon: 'p-treenode-icon',
label: 'p-treenode-label',
subgroup: 'p-treenode-children',

checkIcon: 'p-checkbox-icon',
emptyMessage: 'p-treenode p-tree-empty-message',
droppoint: 'p-treenode-droppoint',
header: 'p-tree-header',
Expand Down
7 changes: 5 additions & 2 deletions components/lib/tree/UITreeNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -681,8 +681,11 @@ export const UITreeNode = React.memo((props) => {
if (isCheckboxSelectionMode() && props.node.selectable !== false) {
const checked = isChecked();
const partialChecked = isPartialChecked();
const icon = checked ? props.checkboxIcon || <CheckIcon /> : partialChecked ? props.checkboxIcon || <MinusIcon /> : null;
const checkboxIcon = IconUtils.getJSXIcon(icon, {}, props);
const checkboxIconProps = mergeProps({
className: cx('checkIcon')
});
const icon = checked ? props.checkboxIcon || <CheckIcon {...checkboxIconProps} /> : partialChecked ? props.checkboxIcon || <MinusIcon {...checkboxIconProps} /> : null;
const checkboxIcon = IconUtils.getJSXIcon(icon, { ...checkboxIconProps }, props);
const checkboxProps = mergeProps(
{
className: cx('nodeCheckbox', { partialChecked }),
Expand Down

0 comments on commit b03ec0f

Please sign in to comment.