Skip to content

Commit

Permalink
Merge pull request #2678 from kush-savani/disable-apply-on-drag-and-drop
Browse files Browse the repository at this point in the history
fix: stop drag and drop while disable file upload input
  • Loading branch information
Akshat55 authored Aug 22, 2023
2 parents 239f025 + e763559 commit 32bf042
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/file-uploader/file-uploader.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ export class FileUploader implements ControlValueAccessor {
onDragOver(event) {
event.stopPropagation();
event.preventDefault();
if (this.disabled) {
return;
}
this.dragOver = true;
}

Expand All @@ -243,6 +246,9 @@ export class FileUploader implements ControlValueAccessor {
onDrop(event) {
event.stopPropagation();
event.preventDefault();
if (this.disabled) {
return;
}

const transferredFiles: Array<File> = Array.from(event.dataTransfer.files);
const newFiles = new Set<FileItem>(this.files);
Expand Down

0 comments on commit 32bf042

Please sign in to comment.