optimized-react-component-library-xyz123 0.19.11 → 0.19.13

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/index.js CHANGED
@@ -702,7 +702,9 @@ var SelectedFiles = ({
702
702
  let newFiles = questionObject.files.filter((f) => f !== file);
703
703
  const newCountOfFiles = newFiles.length;
704
704
  setNumberOfFiles(newCountOfFiles);
705
- const e = { target: { value: `${newCountOfFiles} files`, files: newFiles } };
705
+ let e = { target: { value: `${newCountOfFiles} files`, files: newFiles } };
706
+ const targetValue = e.target.value === "0 files" ? "" : e.target.value;
707
+ e = { ...e, target: { ...e.target, value: targetValue } };
706
708
  isTouched(e, questionObject);
707
709
  removeFile(newCountOfFiles);
708
710
  };
@@ -988,19 +990,14 @@ var AddFiles = ({
988
990
  });
989
991
  };
990
992
  (0, import_react7.useEffect)(() => {
991
- let e;
992
993
  if (newFiles.length > 0) {
993
994
  const currentFiles = questionObject.files ? questionObject.files : [];
994
- e = {
995
+ const e = {
995
996
  target: {
996
997
  value: currentFiles.length + newFiles.length > 0 ? `${currentFiles.length + newFiles.length} files` : "",
997
998
  files: [...currentFiles, ...newFiles]
998
999
  }
999
1000
  };
1000
- console.log("Files added 1:", JSON.stringify(e));
1001
- const targetValue = e.target.value === "0 files" ? "" : e.target.value;
1002
- e = { ...e, target: { ...e.target, value: targetValue } };
1003
- console.log("Files added 2:", JSON.stringify(e));
1004
1001
  handleQuestionInputChange(e, questionObject);
1005
1002
  setNumberOfFiles(currentFiles.length + newFiles.length);
1006
1003
  setNewFiles([]);