Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fileupload component disables upload button #14046

Closed
capkaempfer opened this issue Nov 7, 2023 · 3 comments · Fixed by #14115
Closed

Fileupload component disables upload button #14046

capkaempfer opened this issue Nov 7, 2023 · 3 comments · Fixed by #14115
Assignees
Labels
LTS-FIXED-14.2.16 LTS-FIXED-15.4.13 Fixed in PrimeNG LTS 15.4.13 LTS-PORTABLE Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@capkaempfer
Copy link

Describe the bug

If the fileupload is configured with the following properties, it will disable the upload button when files are uploaded one after the other.

[multiple]="true"
[maxFileSize]="maxSize"
[fileLimit]="4"
[customUpload]="true"
[showCancelButton]="false"
[showUploadButton]="false"
[auto]="true"
(uploadHandler)="emitFiles($event.files)"

Environment

Angular: 16.2.7
PrimeNG: 16.7.0
Browser: latest Chrome

Reproducer

https://stackblitz.com/edit/djzi3p?file=src%2Fapp%2Fdemo%2Ffile-upload-basic-demo.ts

Angular version

16.2.7

PrimeNG version

16.7.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

16.20.2

Browser(s)

No response

Steps to reproduce the behavior

  1. configure fileupload as seen above
  2. click the choose button
  3. select a single file and open
  4. click the choose button again
  5. select a second single file and open
  6. the select button will now be disabled

Expected behavior

After investigating in the code, the isChooseDisabled somehow adds files.length and the uploadedFileCount variable to compare to the maximum number of files.
I do not understand why it even adds it like that or why uploadedFileCount is counted in the first place.

@capkaempfer capkaempfer added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 7, 2023
@ashikjs
Copy link
Contributor

ashikjs commented Nov 14, 2023

Actually this case for multiple select feature not working properly.

@capkaempfer
Copy link
Author

Definitely, but why is files.length and uploadedFileCount added to eachother to determine wether the file limit is exceeded?

@ashikjs
Copy link
Contributor

ashikjs commented Nov 14, 2023

@capkaempfer ya, Here have some miss calculation so we need to fixed it. soon.

@cetincakiroglu cetincakiroglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Nov 17, 2023
@cetincakiroglu cetincakiroglu added this to the 16.8.0 milestone Nov 17, 2023
cetincakiroglu added a commit that referenced this issue Nov 17, 2023
Fixed #14046 - Fileupload | Unexpected disable behavior fix
@mehmetcetin01140 mehmetcetin01140 added the LTS-FIXED-15.4.13 Fixed in PrimeNG LTS 15.4.13 label Nov 17, 2023
@mehmetcetin01140 mehmetcetin01140 self-assigned this Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LTS-FIXED-14.2.16 LTS-FIXED-15.4.13 Fixed in PrimeNG LTS 15.4.13 LTS-PORTABLE Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants