diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ccb2d31..ae3ba0fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 3.4.1 + +* Fix empty array in form would trigger a file upload + ## 3.4.0 * Add enum input guesser diff --git a/src/hydra/dataProvider.ts b/src/hydra/dataProvider.ts index 4c2c506c..abb65d71 100644 --- a/src/hydra/dataProvider.ts +++ b/src/hydra/dataProvider.ts @@ -257,7 +257,7 @@ function dataProvider( const values = Object.values(hydraData); const containFile = (element: unknown): boolean => Array.isArray(element) - ? element.every((value) => containFile(value)) + ? element.length > 0 && element.every((value) => containFile(value)) : isPlainObject(element) && Object.values(element as Record).some( (value) => value instanceof File,