Skip to content

Commit

Permalink
fix: fix array file wrong UX that will make user feel that can add mo…
Browse files Browse the repository at this point in the history
…re files step by step (#1601)

Because

- For multiple file upload the user need to select all the file at once
instead of upload file one by one

This commit

- fix array file wrong UX that will make user feel that can add more
files step by step
  • Loading branch information
EiffelFly authored Nov 18, 2024
1 parent af3526b commit 7c6b342
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const AudiosField = ({
binaries.push(binary);
}
field.onChange(binaries);
setAudioFiles((prev) => [...prev, ...files]);
setAudioFiles(() => files);
}
}}
disabled={disabled}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const FilesField = ({
binaries.push(binary);
}
field.onChange(binaries);
setUploadedFiles((prev) => [...prev, ...files]);
setUploadedFiles(() => files);
}
}}
disabled={disabled}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export const ImagesField = ({
binaries.push(binary);
}
field.onChange(binaries);
setImageFiles((prev) => [...prev, ...files]);
setImageFiles(() => files);
}
}}
disabled={disabled}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ export const VideosField = ({
binaries.push(binary);
}
field.onChange(binaries);
setVideoFiles((prev) => [...prev, ...files]);
}
}}
disabled={disabled}
Expand Down

0 comments on commit 7c6b342

Please sign in to comment.