@dmitryvim/form-builder 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -2064,6 +2064,7 @@ function renderMultipleFileElement(element, ctx, wrapper, pathKey) {
2064
2064
  function validateFileElement(element, key, context) {
2065
2065
  const errors = [];
2066
2066
  const { scopeRoot, skipValidation, path } = context;
2067
+ const isMultipleField = element.type === "files" || "multiple" in element && Boolean(element.multiple);
2067
2068
  const validateFileCount = (key2, resourceIds, element2) => {
2068
2069
  if (skipValidation) return;
2069
2070
  const minFiles = "minCount" in element2 ? element2.minCount ?? 0 : 0;
@@ -2078,7 +2079,7 @@ function validateFileElement(element, key, context) {
2078
2079
  errors.push(`${key2}: maximum ${maxFiles} files allowed`);
2079
2080
  }
2080
2081
  };
2081
- if ("multiple" in element && element.multiple) {
2082
+ if (isMultipleField) {
2082
2083
  const fullKey = pathJoin(path, key);
2083
2084
  const pickerInput = scopeRoot.querySelector(
2084
2085
  `input[type="file"][name="${fullKey}"]`