I am on Drupal 9.3.x
I just discovered that File Field in node entity form which is marked as required, not showing client side validation fail message. Rather it submitting the form and then showing the validation fail message.
This is causing issue for my modal form. I am loading the entity form's custom form mode into modal. The file field is marked as required, actually its a media field which is linked with a field field. So when user submitting the form, its not validating that, file is not uploaded and submitting the form, getting out of modal window and showing the validation fail message.
Searched in the net a lot, getting no clue. The following things tried:
- Added an another test file field (not media field), its the same results
- Added a custom managed file field using hook_form_alter, its the same results
- Tried to submit the form through ajax, I see no form error reported for media field field
I am not sure if the as designed by Drupal or if there is any fix for it.
One more thing, field is added inside commerce product and field is showing inside inline entity form in simple mode.
Please help. :(