Shun Miyazawa 3 месяцев назад
Родитель
Сommit
67091befb6
1 измененных файлов с 15 добавлено и 13 удалено
  1. 15 13
      apps/app/src/features/page-tree/hooks/_inner/use-tree-item-handlers.tsx

+ 15 - 13
apps/app/src/features/page-tree/hooks/_inner/use-tree-item-handlers.tsx

@@ -130,19 +130,21 @@ export const useTreeItemHandlers = (
     [],
   );
 
-  const completeRenamingHotkey: completeRenamingHotkey = useMemo(() => ({
-    hotkey: 'Enter',
-    allowWhenInputFocused: true,
-    isEnabled: (tree) => tree.isRenamingItem(),
-    handler: (e, tree) => {
-      // Disable rename during IME composition
-      if (e.isComposing) {
-        return;
-      }
-
-      tree.completeRenaming();
-    },
-  }), []);
+  const completeRenamingHotkey: completeRenamingHotkey = useMemo(
+    () => ({
+      hotkey: 'Enter',
+      allowWhenInputFocused: true,
+      isEnabled: (tree) => tree.isRenamingItem(),
+      handler: (e, tree) => {
+        // Disable rename during IME composition
+        if (e.isComposing) {
+          return;
+        }
+        tree.completeRenaming();
+      },
+    }),
+    []
+  );
 
   return {
     getItemName,