diff --git a/src/useCSVReader.tsx b/src/useCSVReader.tsx index 387db2d..24cda31 100644 --- a/src/useCSVReader.tsx +++ b/src/useCSVReader.tsx @@ -39,6 +39,7 @@ export interface Props { noDrag?: boolean; noDragEventsBubbling?: boolean; noKeyboard?: boolean; + noProgressBar?: boolean; multiple?: boolean; required?: boolean; preventDropOnDocument?: boolean; @@ -72,6 +73,7 @@ function useCSVReaderComponent() { noDrag = false, noDragEventsBubbling = false, noKeyboard = false, + noProgressBar = false, multiple = false, required = false, preventDropOnDocument = true, @@ -282,7 +284,9 @@ function useCSVReaderComponent() { type: 'setFiles', }); - setDisplayProgressBar('block'); + if (!noProgressBar) { + setDisplayProgressBar('block'); + } // if (onDrop) { // onDrop(acceptedFiles, fileRejections, event) @@ -352,9 +356,11 @@ function useCSVReaderComponent() { PapaParse.parse(e.target.result, configs); }; reader.onloadend = () => { - setTimeout(() => { - setDisplayProgressBar('none'); - }, 2000); + if (!noProgressBar) { + setTimeout(() => { + setDisplayProgressBar('none'); + }, 2000); + } }; reader.readAsText(file, config.encoding || 'utf-8'); });