소스 검색

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

include the old state when setting new
Artur Paikin 1 년 전
부모
커밋
865334faa9
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  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 = () => {