Skip to content

TagSpaces is an offline, open source, document manager with tagging support

TSN497 Cancel renaming files does not restore initial value (#1240)

Stanimir410b2ef8a3c7
diff --git a/app/components/EntryProperties.tsx b/app/components/EntryProperties.tsx
index 21633bda1..d9e08c77b 100644
--- a/app/components/EntryProperties.tsx
+++ b/app/components/EntryProperties.tsx
@@ -279,15 +279,16 @@ const EntryProperties = (props: Props) => {
}
if (editName !== undefined) {
setEditName(undefined);
- /* this.setState({
- isEditName: false,
- name: this.state.originalName
- }); */
+ } else {
+ setEditName(fileName);
}
};
const deactivateEditNameField = () => {
- setEditName(fileName);
+ setEditName(undefined);
+ if (fileNameRef) {
+ fileNameRef.current.value = fileName;
+ }
};
const toggleEditDescriptionField = () => {