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.mjs CHANGED
@@ -620,7 +620,9 @@ var SelectedFiles = ({
620
620
  let newFiles = questionObject.files.filter((f) => f !== file);
621
621
  const newCountOfFiles = newFiles.length;
622
622
  setNumberOfFiles(newCountOfFiles);
623
- const e = { target: { value: `${newCountOfFiles} files`, files: newFiles } };
623
+ let e = { target: { value: `${newCountOfFiles} files`, files: newFiles } };
624
+ const targetValue = e.target.value === "0 files" ? "" : e.target.value;
625
+ e = { ...e, target: { ...e.target, value: targetValue } };
624
626
  isTouched(e, questionObject);
625
627
  removeFile(newCountOfFiles);
626
628
  };
@@ -906,19 +908,14 @@ var AddFiles = ({
906
908
  });
907
909
  };
908
910
  useEffect5(() => {
909
- let e;
910
911
  if (newFiles.length > 0) {
911
912
  const currentFiles = questionObject.files ? questionObject.files : [];
912
- e = {
913
+ const e = {
913
914
  target: {
914
915
  value: currentFiles.length + newFiles.length > 0 ? `${currentFiles.length + newFiles.length} files` : "",
915
916
  files: [...currentFiles, ...newFiles]
916
917
  }
917
918
  };
918
- console.log("Files added 1:", JSON.stringify(e));
919
- const targetValue = e.target.value === "0 files" ? "" : e.target.value;
920
- e = { ...e, target: { ...e.target, value: targetValue } };
921
- console.log("Files added 2:", JSON.stringify(e));
922
919
  handleQuestionInputChange(e, questionObject);
923
920
  setNumberOfFiles(currentFiles.length + newFiles.length);
924
921
  setNewFiles([]);