Skip to content

Commit

Permalink
Pressing the 'a' key when onCreate is not defined (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
rafma0 authored Jan 10, 2023
1 parent 0a57bce commit bff7f42
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/react-arborist/src/components/default-container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,7 @@ export function DefaultContainer() {
tree.selectAll();
return;
}
if (e.key === "a" && !e.metaKey) {
if (!tree.props.onCreate) return;
if (e.key === "a" && !e.metaKey && tree.props.onCreate) {
tree.createLeaf();
return;
}
Expand Down

0 comments on commit bff7f42

Please sign in to comment.