Skip to content

Commit

Permalink
Fixed #14046 - Fileupload | Unexpected disable behavior fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmetcetin01140 committed Nov 14, 2023
1 parent 7216049 commit a2476be
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/app/components/fileupload/fileupload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit a2476be

Please sign in to comment.