Przeglądaj źródła

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

include the old state when setting new
Artur Paikin 1 rok temu
rodzic
commit
865334faa9

+ 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 = () => {