For required fields that are not specified, it would be nice to add a "[Title] is required." error to the list of field errors upon validating, as opposed to the existing behavior wherein an HTML5 required attribute is added to the field.
Observe that RJSF has added a 'First name is required' error message below the field, and within the Errors summary displayed at top.
Observe the HTML5 required field message displayed for the field, with browser-specific styling (i.e. related to https://github.com/mozilla-services/react-jsonschema-form/issues/159). More critically, it seems support for the required attribute is still absent from Safari - so if you go through the above 'Steps to Reproduce' on your iPhone using Safari, for example, nothing happens, and it's not clear why.
Version used on the playground.
I'm definitely keen to help out with trying to make this happen, but wanted to check with the core contributors if there was a specific reason why things are implemented the way they are, and any tips they might have for resolving this issue (Note: I understand it makes sense to leverage HTML5 technologies where possible, but in this case, required field functionality is currently "broken" in Safari).
Thanks for the great library!
Yeah, we need to drop our use of HTML5 validation attributes, they make the UX inconsistent and their implementation is far too inconsistent across platforms as well.
See #159, #326 and possibly others.
Thanks for the great library!
Thanks, always appreciated :)
PS: Patches are welcome :smiley_cat:
Thanks for the reply. I'll dig through the library in more detail, and try to make this happen!
Do we have any update on this issue?
No, do you want to work on this?
@n1k0 I made a couple changes in a fork of this library that would address this. Those changes are:
novalidate on the html form element.I can make one or both of those changes into a PR if that seem like appropriate changes. The second one could be left to users to implement once my transformErrors PR is merged instead.
Add an option on the form component that sets novalidate on the html form element.
I'm definitely interested in this, please send a PR :)
Most helpful comment
Thanks for the reply. I'll dig through the library in more detail, and try to make this happen!