Explorar o código

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

include the old state when setting new
Artur Paikin hai 1 ano
pai
achega
865334faa9
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  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 = () => {