From ea707b5f45fa586d79a6760918b1d18c57551c76 Mon Sep 17 00:00:00 2001 From: rafma0 Date: Sun, 8 Jan 2023 02:29:23 -0300 Subject: [PATCH] fix for when pressing the 'a' key and onCreate is not defined --- packages/react-arborist/src/components/default-container.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/react-arborist/src/components/default-container.tsx b/packages/react-arborist/src/components/default-container.tsx index d0fd4b2c..112e9b38 100644 --- a/packages/react-arborist/src/components/default-container.tsx +++ b/packages/react-arborist/src/components/default-container.tsx @@ -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; }