fix not submit rename on press enter

This commit is contained in:
codetypes committed 2024-11-30 16:05:34 +08:00
1 parent c933541f3e
commit 041b793f20
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -402,7 +402,7 @@ export const Explorer: FC = () => {
useKeyDown([Hotkey.F2, isMacos ? Hotkey.Enter : ""], keysRef, (event) => { useKeyDown([Hotkey.F2, isMacos ? Hotkey.Enter : ""], keysRef, (event) => {
event.preventDefault(); event.preventDefault();
const node = findFile(selectedKeys[0], workspace.fileTree!); const node = findFile(selectedKeys[0], workspace.fileTree!);
if (node && node !== workspace.fileTree) { if (node && node !== workspace.fileTree && !node.editing) {
dispatch("rename", node); dispatch("rename", node);
} }
}); });