From c3ee3c1fcd40bc53254fdcc16eef76779aa16647 Mon Sep 17 00:00:00 2001 From: Melloware Date: Fri, 24 Nov 2023 08:27:33 -0500 Subject: [PATCH] Fix #5370: TreeTable highlight selection in Checkbox mode (#5372) --- components/lib/treetable/TreeTableRow.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/lib/treetable/TreeTableRow.js b/components/lib/treetable/TreeTableRow.js index 968712d19f..96abd840d1 100644 --- a/components/lib/treetable/TreeTableRow.js +++ b/components/lib/treetable/TreeTableRow.js @@ -332,8 +332,11 @@ export const TreeTableRow = React.memo((props) => { }; const isSelected = () => { - if ((props.selectionMode === 'single' || props.selectionMode === 'multiple') && props.selectionKeys) return props.selectionMode === 'single' ? props.selectionKeys === props.node.key : props.selectionKeys[props.node.key] !== undefined; - else return false; + if (props.selectionMode === 'single' || ((props.selectionMode === 'multiple' || props.selectionMode === 'checkbox') && props.selectionKeys)) { + return props.selectionMode === 'single' ? props.selectionKeys === props.node.key : props.selectionKeys[props.node.key] !== undefined; + } + + return false; }; const isChecked = () => {