Skip to content

Commit

Permalink
Fix node expanded if not filtering (#7659)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieumota authored Jan 30, 2025
1 parent bef72fb commit 147476a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions components/lib/tree/Tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@ export const Tree = React.memo(
dragdropScope={props.dragdropScope}
expandIcon={props.expandIcon}
expandedKeys={expandedKeys}
isFiltering={isFiltering}
isNodeLeaf={isNodeLeaf}
metaKeySelection={props.metaKeySelection}
nodeTemplate={props.nodeTemplate}
Expand Down
4 changes: 3 additions & 1 deletion components/lib/tree/UITreeNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export const UITreeNode = React.memo((props) => {
const mergeProps = useMergeProps();
const isLeaf = props.isNodeLeaf(props.node);
const label = props.node.label;
const expanded = props.expandedKeys ? props.expandedKeys[props.node.key] !== undefined : false;
const isFiltering = props.isFiltering;
const expanded = (props.expandedKeys ? props.expandedKeys[props.node.key] !== undefined : false) || (!isFiltering && props.node.expanded);
const { ptm, cx } = props;

const getPTOptions = (key) => {
Expand Down Expand Up @@ -908,6 +909,7 @@ export const UITreeNode = React.memo((props) => {
dragdropScope={props.dragdropScope}
expandIcon={props.expandIcon}
expandedKeys={props.expandedKeys}
isFiltering={props.isFiltering}
index={index}
isNodeLeaf={props.isNodeLeaf}
last={index === props.node.children.length - 1}
Expand Down

0 comments on commit 147476a

Please sign in to comment.