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: when multiple files are selected and more than one has errors only only one message is shown #13397

Closed
ajjp opened this issue Jul 29, 2023 · 1 comment · Fixed by #13399
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@ajjp
Copy link

ajjp commented Jul 29, 2023

Describe the bug

When I select more than one file either by opening the file chooser or drag to the drag and drop and if more than one is invalid - wrong type, file size limit exceeded , only one message is shown.

I believe the problem is in the "validate" method that is cleaning the "msgs" array in every file validation:

The code is:
this.msgs = []

And should be:
this.msgs ??= []

image

Environment

Windows

Reproducer

No response

Angular version

16.1.3

PrimeNG version

16.0.2

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.17.0

Browser(s)

Chrome

Steps to reproduce the behavior

  1. Select more than one file either by clicking the file choose button or by dragging them to the drop area
  2. Only one error message is shown

Expected behavior

Display all files with errors and not only the last one validated

@ajjp ajjp added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jul 29, 2023
@SoyDiego
Copy link
Contributor

I have checked the problem and I did a PR with the solution here: #13399
Now we should wait if PrimeNG Team approve it.
Thanks!

@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 Aug 2, 2023
@cetincakiroglu cetincakiroglu added this to the 16.1.1 milestone Aug 2, 2023
@cetincakiroglu cetincakiroglu added the LTS-PORTABLE Issue's fix will be ported to supported LTS versions label Aug 2, 2023
@gucal gucal added LTS-FIXED-15.4.8 and removed LTS-PORTABLE Issue's fix will be ported to supported LTS versions labels Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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