Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

noHtml5Validate should be true by default #1184

Closed
3 tasks done
alexose opened this issue Feb 15, 2019 · 6 comments
Closed
3 tasks done

noHtml5Validate should be true by default #1184

alexose opened this issue Feb 15, 2019 · 6 comments

Comments

@alexose
Copy link

alexose commented Feb 15, 2019

Prerequisites

Description

The default HTML5 validation makes for a confusing UX. For end users, the styling and behavior is inconsistent with the rest of the library (see n1k0's comment here). For developers who are new to react-jsonschema-form, it makes for a puzzling situation when you try to customize how errors are displayed.

Steps to Reproduce

In Chrome:

  1. Create a react-jsonschema-form with a single required field
  2. Submit the form
  3. Observe the 'Please fill out this field' box that appears.

Expected behavior

react-jsonschema-form should have displayed its normal error handling.

Actual behavior

The default html5 form validation overrode the normal error handling.

Version

1.2.1

You can usually get this information in your package.json or in the file URL if you're using the unpkg one.

@epicfaace
Copy link
Member

epicfaace commented Feb 24, 2019

That's a good point. I'm wondering whether it's worth it to introduce this change at this point, since it really might cause some backwards-incompatible behavior and it's not too hard to work around it right now. What do you think @glasserc @edi9999 @LucianBuzzo ?

@edi9999
Copy link
Collaborator

edi9999 commented Feb 25, 2019

I think like you, it is a good idea but since it is backwards incompatible, it should be done in v2 only

@LucianBuzzo
Copy link
Collaborator

@edi9999 @epicfaace This interaction is pretty horrible, especially for checkbox/boolean fields. It's definitely a breaking change though, so it should coincide with a major version bump of the npm package.

@epicfaace epicfaace added this to To do in V2 Feb 25, 2019
@sbusch
Copy link
Contributor

sbusch commented Feb 26, 2019

+1 for disabling html5 validation by default in V2

I wonder if there's a legitimate need for HTML5 validation? If no, the noHtml5Validate prop and DOM attributes related to HTML5 form validation could be removed completely.

@glasserc
Copy link
Contributor

glasserc commented Mar 6, 2019

I would be OK with disabling HTML5 validation in V2.

@epicfaace epicfaace moved this from To do to Won't do in V2 Sep 9, 2019
mattcosta7 added a commit to mattcosta7/react-jsonschema-form that referenced this issue Mar 25, 2021
By default, displaying html 5 validations on forms provides a much more
intuitive user experience and ensures a standardized method for
generating and displaying form validation errors

fixes rjsf-team#1184
BREAKING_CHANGE
mattcosta7 added a commit to mattcosta7/react-jsonschema-form that referenced this issue Mar 27, 2021
By default, displaying html 5 validations on forms provides a much more
intuitive user experience and ensures a standardized method for
generating and displaying form validation errors

fixes rjsf-team#1184
BREAKING_CHANGE
@stale
Copy link

stale bot commented Apr 15, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please leave a comment if this is still an issue for you. Thank you.

@stale stale bot added the wontfix label Apr 15, 2022
@stale stale bot closed this as completed May 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
V2
  
Won't do in v2
Development

Successfully merging a pull request may close this issue.

6 participants