Skip to content

Commit bc86cc7

Browse files
authored
fix: empty array in form would trigger a file upload (#482)
1 parent ae2f272 commit bc86cc7

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 3.4.1
4+
5+
* Fix empty array in form would trigger a file upload
6+
37
## 3.4.0
48

59
* Add enum input guesser

src/hydra/dataProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ function dataProvider(
257257
const values = Object.values(hydraData);
258258
const containFile = (element: unknown): boolean =>
259259
Array.isArray(element)
260-
? element.every((value) => containFile(value))
260+
? element.length > 0 && element.every((value) => containFile(value))
261261
: isPlainObject(element) &&
262262
Object.values(element as Record<string, unknown>).some(
263263
(value) => value instanceof File,

0 commit comments

Comments
 (0)