From 73c044f4e8dbf3a00ccb9d9f8ccc8e388d280dcb Mon Sep 17 00:00:00 2001
From: Jose Manuel Serrano Amaut <a20122128@pucp.pe>
Date: Thu, 16 Mar 2023 22:36:57 -0500
Subject: [PATCH] [FIX]: Solve isse that allows to select or drop files when
 upload has started.

---
 .../components/dropzone/components/dropzone/Dropzone.tsx  | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/files-ui/components/dropzone/components/dropzone/Dropzone.tsx b/src/files-ui/components/dropzone/components/dropzone/Dropzone.tsx
index 1cbafa2..21c8375 100644
--- a/src/files-ui/components/dropzone/components/dropzone/Dropzone.tsx
+++ b/src/files-ui/components/dropzone/components/dropzone/Dropzone.tsx
@@ -130,6 +130,7 @@ const Dropzone: React.FC<DropzoneProps> = (props: DropzoneProps) => {
     style: containerStyle,
     className: containerClassName,
   } = actionButtons as DropzoneActions;
+
   const styleBorderRadius: string | number | undefined = style?.borderRadius;
 
   const {
@@ -195,7 +196,6 @@ const Dropzone: React.FC<DropzoneProps> = (props: DropzoneProps) => {
     localization,
     validateFilesFlag
   );
-
   /**
    * Uploads each file in the array of ExtFiles
    * First, sets all the files in preparing status and awaits `preparingTime` miliseconds.
@@ -570,7 +570,7 @@ const Dropzone: React.FC<DropzoneProps> = (props: DropzoneProps) => {
   // HANDLERS for CLICK, DRAG NAD DROP
   function handleClick(): void {
     //handleClickUtil(evt);
-    if (!clickable) return;
+    if (!clickable || disabled || isUploading) return;
     makeRipple();
     handleClickInput(inputRef.current);
   }
@@ -626,12 +626,12 @@ const Dropzone: React.FC<DropzoneProps> = (props: DropzoneProps) => {
 
     if (disabled) return;
 
+    if (isUploading) return;
+
     if (!disableRipple) makeRipple();
 
     setIsDragging(false);
 
-    if (isUploading) return;
-
     let fileList: FileList = evt.dataTransfer.files;
 
     let extFileListOutput: ExtFile[] = fileListToExtFileArray(fileList);
-- 
GitLab