From a2476be275eb0ef9cb6894365eb0343aaff150be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20=C3=87etin?= <92744169+mehmetcetin01140@users.noreply.github.com> Date: Tue, 14 Nov 2023 15:37:40 +0300 Subject: [PATCH 1/2] Fixed #14046 - Fileupload | Unexpected disable behavior fix --- src/app/components/fileupload/fileupload.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/app/components/fileupload/fileupload.ts b/src/app/components/fileupload/fileupload.ts index 65fc204eb4e..9309b72c981 100755 --- a/src/app/components/fileupload/fileupload.ts +++ b/src/app/components/fileupload/fileupload.ts @@ -743,15 +743,25 @@ export class FileUpload implements AfterViewInit, AfterContentInit, OnInit, OnDe } isFileLimitExceeded() { - if (this.fileLimit && this.fileLimit <= this.files.length + this.uploadedFileCount && this.focus) { + const isAutoMode = this.auto; + const totalFileCount = isAutoMode ? this.files.length : this.files.length + this.uploadedFileCount; + + if (this.fileLimit && this.fileLimit <= totalFileCount && this.focus) { this.focus = false; } - return this.fileLimit && this.fileLimit < this.files.length + this.uploadedFileCount; + return this.fileLimit && this.fileLimit < totalFileCount; } isChooseDisabled() { - return this.fileLimit && this.fileLimit <= this.files.length + this.uploadedFileCount; + if (this.auto) { + + return this.fileLimit && this.fileLimit <= this.files.length; + + } else { + + return this.fileLimit && this.fileLimit <= this.files.length + this.uploadedFileCount; + } } checkFileLimit() { From 1993faa684c4549f4aa8eb946a714514ed36bad3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20=C3=87etin?= <92744169+mehmetcetin01140@users.noreply.github.com> Date: Tue, 14 Nov 2023 18:11:30 +0300 Subject: [PATCH 2/2] code format --- src/app/components/fileupload/fileupload.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/app/components/fileupload/fileupload.ts b/src/app/components/fileupload/fileupload.ts index 9309b72c981..aad352517e8 100755 --- a/src/app/components/fileupload/fileupload.ts +++ b/src/app/components/fileupload/fileupload.ts @@ -755,11 +755,8 @@ export class FileUpload implements AfterViewInit, AfterContentInit, OnInit, OnDe isChooseDisabled() { if (this.auto) { - return this.fileLimit && this.fileLimit <= this.files.length; - } else { - return this.fileLimit && this.fileLimit <= this.files.length + this.uploadedFileCount; } }