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

[BUG] File size exceeded error not handled and submit button is still active and allows submission #5990

Open
uppalabharath opened this issue Jan 22, 2025 · 2 comments

Comments

@uppalabharath
Copy link

Describe the bug

  • Use File component and configure max size to 10 MB
  • Upload a file of size more than 10 MB
  • Observe that error is shown that file exceeded size limit
  • Submit button is still enabled and submitting sends empty file data

Version/Branch
master (https://formio.github.io/formio.js/app/builder)

To Reproduce
Steps to reproduce the behavior:

  • Use File component and configure max size to 10 MB
  • Upload a file of size more than 10 MB
  • Observe that error is shown that file exceeded size limit
  • Submit button is still enabled and submitting sends empty file data

Expected behavior

  • Disable submit button if there are any errors

Screenshots

Image
@lane-formio
Copy link
Contributor

lane-formio commented Jan 27, 2025

You have to set the component to "Required" if you want to require the file upload, I would suggest the form otherwise is in a valid state.

@uppalabharath
Copy link
Author

@lane-formio seems to me like a workaround to mark the field as required.

When an error is reported, It should prevent the submission and disable the submit button like any other errorrs.
Do we do the same if I added any custom validation on any other field. Like some regex on a text field, In those cases I see the submit button getting disabled

@lane-formio lane-formio reopened this Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants