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 Invalid File messages not displaying on repeat attempts #1399

Closed
Roxerg opened this issue Aug 1, 2021 · 0 comments
Closed

FileUpload Invalid File messages not displaying on repeat attempts #1399

Roxerg opened this issue Aug 1, 2021 · 0 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working vue2-portable
Milestone

Comments

@Roxerg
Copy link

Roxerg commented Aug 1, 2021

I'm submitting a ... (check one with "x")

[x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primevue/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=110

CodeSandbox Case (Bug Reports)
Please demonstrate your case at CodeSandbox by using the issue template below. Issues without a test case have much less possibility to be reviewed in detail and assisted.

https://codesandbox.io/s/magical-framework-bzus5?file=/src/App.vue

Current behavior
Using Advanced style of FileUpload, selecting a file that exceeds maxFileSize or does not match accept pattern displays the invalid file message. Clicking the button to close this message, and choosing the exact same file will fail silently without showing the message.
Selecting a different file after closing the error message displays a new error correctly.

Expected behavior
selecting a file that exceeds maxFileSize or does not match accept pattern displays the invalid file message. Clicking the button to close this message, and choosing the exact same file displays the same invalid file message again.

Minimal reproduction of the problem with instructions

  1. Create a FileUpload element with maxFileSize or accept set.
  2. Attempt to upload a file that violates one of these constraints. (use the drag-and-drop field to violate the accept constraint)
  3. Close the error message with the X button
  4. Attempt to upload the same exact file.
  5. The error message does not appear.

CodeSandbox with file size constraint set to 1:

https://codesandbox.io/s/magical-framework-bzus5?file=/src/App.vue

The issue can be replicated on PrimeVue showcase as well:

https://primefaces.org/primevue/showcase/#/fileupload

What is the motivation / use case for changing the behavior?
If the user absent-mindedly closes the first error message and chooses the same file, the component appears to not react and may lead the user to believe the file upload feature is broken.
If this functionality is tied to filenames, this could also cause issues with files that have identical names but different properties.

Please tell us about your environment:

Tested on:

Windows 10, Visual Studio Code, npm
Manjaro 19.0, Visual Studio Code, npm

  • Vue version: 3.1.5
  • PrimeVue version: 3.6.0
  • Browser: all
    • Tested on:
      • Microsoft Edge Version 92.0.902.55 (Official build) (64-bit)
      • Brave Version 1.26.74 Chromium: 91.0.4472.124 (Official Build) (64-bit)
      • Firefox Version 90.0.2 (64-bit)
@cagataycivici cagataycivici self-assigned this Aug 19, 2021
@cagataycivici cagataycivici added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Aug 19, 2021
@cagataycivici cagataycivici added this to the 3.7.0 milestone Aug 19, 2021
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 vue2-portable
Projects
None yet
Development

No branches or pull requests

4 participants