Browse Source

If no descendant pages exist, force open when enter is pressed

Shun Miyazawa 4 years ago
parent
commit
caf95aacff
1 changed files with 5 additions and 0 deletions
  1. 5 0
      packages/app/src/components/Sidebar/PageTree/Item.tsx

+ 5 - 0
packages/app/src/components/Sidebar/PageTree/Item.tsx

@@ -341,6 +341,11 @@ const Item: FC<ItemProps> = (props: ItemProps) => {
     }
 
     try {
+
+      if (!hasDescendants) {
+        setIsOpen(true);
+      }
+
       setCreating(true);
 
       await apiv3Post('/pages/', {