Skip to content

Commit

Permalink
fix: fix tree behaviour when space is pressed on expandable nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
wildergd committed Aug 8, 2020
1 parent a7a0ca4 commit 7aad7e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/Tree/hooks/useKeyNavigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ export default function useKeyNavigation({
onNodeSelect({ name, nodePath });
},
[SPACE_KEY]: props => {
const { name, nodePath } = props;
onNodeSelect({ name, nodePath });
const { name, nodePath, children } = props;
if (children) onNodeExpand({ name, nodePath });
},
}),
[onNodeSelect, onNodeExpand, visibleNodes],
Expand Down

0 comments on commit 7aad7e4

Please sign in to comment.