Browse Source

@uppy/dashboard: include the old state when setting new (#4490)

include the old state when setting new
Artur Paikin 1 year ago
parent
commit
865334faa9
1 changed files with 4 additions and 1 deletions
  1. 4 1
      packages/@uppy/dashboard/src/components/FileCard/index.jsx

+ 4 - 1
packages/@uppy/dashboard/src/components/FileCard/index.jsx

@@ -46,7 +46,10 @@ export default function FileCard (props) {
   }, [saveFileCard, formState, fileCardFor])
 
   const updateMeta = (newVal, name) => {
-    setFormState({ [name]: newVal })
+    setFormState({
+      ...formState,
+      [name]: newVal,
+    })
   }
 
   const handleCancel = () => {