Skip to content

Commit 6455e3b

Browse files
authored
remove input box when user deselects the title of a folder or a file (#338)
1 parent fef570b commit 6455e3b

File tree

1 file changed

+9
-0
lines changed
  • frontend/src/packages/dashboard/components/FileRenderer

1 file changed

+9
-0
lines changed

frontend/src/packages/dashboard/components/FileRenderer/Renamable.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export default function Renamable({ name, id }: Props) {
2626
dispatch(renameFileEntityAction(newPayload));
2727
};
2828

29+
2930
return (
3031
<>
3132
{toggle ? (
@@ -49,6 +50,14 @@ export default function Renamable({ name, id }: Props) {
4950
event.stopPropagation();
5051
}
5152
}}
53+
54+
onBlur={(event) => {
55+
handleRename(inputName);
56+
setToggle(true);
57+
event.preventDefault();
58+
event.stopPropagation();
59+
}}
60+
autoFocus
5261
/>
5362
)}
5463
</>

0 commit comments

Comments
 (0)