- Issue created by @prudloff
- π¦πΊAustralia kim.pepper πββοΈπ¦πΊSydney, Australia
I know there is an existing issue about this somewhere but I can't find it.
It seems the required attribute does nothing on file inputs.
This could be a problem for
π
#states not affecting visibility/requirement of managed_file
Needs work
and
π
managed_file HTML5 required validation
Needs work
, these issues will add new ways to have this attribute on input fields so it needs to do something.
This seems to happen because disableFields() in file.js disabled input fields when submitting the form, so the required attribute is not triggered by the browser.
I suppose there is a good reason to do this but it could probably be improved.
Override the input--file.html.twig template to add the required attribute on file inputs.
Add a file field on a node bundle.
Browse to the create form for this bundle.
Leave the file field empty and click on Save: the browser does not prevent submitting the form.
Active
11.0 π₯
file system
I know there is an existing issue about this somewhere but I can't find it.