diff --git a/packages/core/src/components/upload/upload.scss b/packages/core/src/components/upload/upload.scss index 52234d8bd98..f3c65eb1dd7 100644 --- a/packages/core/src/components/upload/upload.scss +++ b/packages/core/src/components/upload/upload.scss @@ -53,7 +53,7 @@ } } - &.file-over { + &:not(.disabled).file-over { border-color: var(--theme-upload--border-color--dragover); border-style: solid; } @@ -73,10 +73,14 @@ } .upload-browser { - opacity: 0; + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; overflow: hidden; + padding: 0; position: absolute; - z-index: -1; + width: 1px; } .loader { diff --git a/packages/core/src/components/upload/upload.tsx b/packages/core/src/components/upload/upload.tsx index 2cb7b7c4d05..e4dacfd21cd 100644 --- a/packages/core/src/components/upload/upload.tsx +++ b/packages/core/src/components/upload/upload.tsx @@ -111,8 +111,10 @@ export class Upload { } private fileOver(event: DragEvent) { - event.preventDefault(); - event.dataTransfer.dropEffect = 'move'; + if (this.state !== UploadFileState.LOADING) { + event.preventDefault(); + event.dataTransfer.dropEffect = 'move'; + } if (!this.multiple && event.dataTransfer.items.length > 1) { event.preventDefault(); @@ -206,12 +208,17 @@ export class Upload {
this.fileDropped(e)} + onDrop={(e) => { + if (this.state !== UploadFileState.LOADING) { + this.fileDropped(e); + } + }} onDragOver={(e) => this.fileOver(e)} onDragLeave={() => this.fileLeave()} draggable={!this.disabled} diff --git a/packages/core/src/tests/upload/upload.e2e.ts-snapshots/upload-basic-1-chromium---theme-classic-dark-linux.png b/packages/core/src/tests/upload/upload.e2e.ts-snapshots/upload-basic-1-chromium---theme-classic-dark-linux.png index 8bb969af244..38a111bf05f 100644 Binary files a/packages/core/src/tests/upload/upload.e2e.ts-snapshots/upload-basic-1-chromium---theme-classic-dark-linux.png and b/packages/core/src/tests/upload/upload.e2e.ts-snapshots/upload-basic-1-chromium---theme-classic-dark-linux.png differ diff --git a/packages/core/src/tests/upload/upload.e2e.ts-snapshots/upload-basic-1-chromium---theme-classic-light-linux.png b/packages/core/src/tests/upload/upload.e2e.ts-snapshots/upload-basic-1-chromium---theme-classic-light-linux.png index 7335c3c5877..738b7f24e33 100644 Binary files a/packages/core/src/tests/upload/upload.e2e.ts-snapshots/upload-basic-1-chromium---theme-classic-light-linux.png and b/packages/core/src/tests/upload/upload.e2e.ts-snapshots/upload-basic-1-chromium---theme-classic-light-linux.png differ