File size validation is not shown with pictures taken with a camera
Describe the bug In the builder, add a file component, choose any storage, select the "Display as image(s)" option and the "Enable Web Camera" option and put a limit on the maximum file size (can be anything as long as the pictures you take with your camera are bigger than the limit)
render the resulting form and try to take a picture using the "Use Camera" option, the picture is not shown (expected) but no error message is shown
Version/Branch @formio/react: 6.0.1, @formio/js: 5.0.1
Also reproduceable in the playground
Not tested on mobile
To Reproduce Need a camera (webcam) Steps to reproduce the behavior:
- Go to the playground
- Add a file component
- Set the provider to Base64
- enable Display as image(s)
- enable Enable Web Camera
- Set file maximum size to 1KB
- Render the form
- click on Use Camera
- Click on take picture
Expected behavior The same error message as if you try to upload a file that is too large in older version: An error message as an alert under the file component:
Screenshots If applicable, add screenshots to help explain your problem.
Additional context It looks like the issue might only be linked to the "Display as image(s)" settings since the issue is present even with the camera disabled Here is the form definition on which the issue is based on:
{
"display": "form",
"components": [
{
"label": "Upload",
"tableView": false,
"storage": "base64",
"image": true,
"webcam": false,
"capture": false,
"fileTypes": [
{
"label": "",
"value": ""
}
],
"fileMaxSize": "1KB",
"validateWhenHidden": false,
"key": "file",
"type": "file",
"input": true
}
]
}