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] 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() {