While working on and testing this plugin I was exposed to some peculiar behavior of the Form Plugin which I wasn't aware of at first. Unfortunately some new bad behaviour was introduced.
issue # 1: The Reset button is supposed to make all the fields in a form empty when clicked. However, this doesn't work for the file field. The thumbnails of files that were already uploaded remain in the file field. Because of this, I chose to modify the Reset button's function. Now, when it's clicked, the entire page gets refreshed. Personally I don't think this matters much.
issue # 2: The built-in validation and the validation provided by this plugin do work together, but they don't get along very well at the moment. To validate the file fields, I had to "intercept" the click on the Submit button using JavaScript. Unfortunately, this resulted in the standard user feedback messages like "Please fill out this field" no longer being displayed. Clearly, this is a step backward in user experience. So, this really bothers me. So far I haven't figured out how to "get the best of both worlds".
issue # 3: When limit
is set to 1 the file picker allows selecting a single file only, but then the user is allowed to select and upload even more files. This should be prevented by disabling the file field once the maximum set by limit
is reached.
There could be more issues. If so please report these in the Grav Forum post about this workaround plugin: Workaround for using ‘validate.required’ on form file fields
It goes without saying that if I would know how to fix or prevent the above mentioned issues, I would have. But I don't. So any help is greatly appreciated!