-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Possible bug? #3440
Comments
It seems as though required field validation is the part that is not working. I apologize if this is something that changed with v5 that is covered in the documentation. |
@nickgros I was using the simple example and deleting either first name or last name and then clicking submit. It looks like #3424 already covers this issue though, so I'm sorry about that. The other issue I was seeing is/was related to html5validation and the first invalid input control being out of view when clicking the submit button. This stackoverflow post seems to describe this behavior as more of a browser implementation feature/bug in which the act of scrolling immediately hides the displayed validation popup. I was seeing the same behavior in both Chrome and Edge. |
Seconding this. We're trying to migrate to v5 and required fields never produce validation errors. On the simple example in the playground, you can submit the form without either of the first name or last name fields filled, and neither will ever show an error. Switching to AJV6 validator makes no difference. |
@tyrdavis The reason the simple example validates is because there is an empty string being provided to the |
…dation Issue rjsf-team#3440 describes the required field validation for `firstName` and `lastName` not working for the simple example - Updated the simple example to remove the `ui:emptyValue` for the `lastName` field so that required field validation works for it. - Also added a placeholder for `firstName` indicating that it will never fail validation due to `ui:emptyValue`
I am updating the simple example to at least make |
@bwied There is a new feature in 5.1.0 that allows you to select whether the form automatically focuses on the first field with a validation error. Maybe this will help you? |
…dation (#3449) Issue #3440 describes the required field validation for `firstName` and `lastName` not working for the simple example - Updated the simple example to remove the `ui:emptyValue` for the `lastName` field so that required field validation works for it. - Also added a placeholder for `firstName` indicating that it will never fail validation due to `ui:emptyValue`
@heath-freenome I'm sorry that I overlooked the ui:emptyValue prop, but thank you for updating the sample anyways. To answer your question, the focusOnFirstError prop did indeed help. I appreciate your follow-up and the continued effort that you and everybody else are putting into this project. |
Prerequisites
What theme are you using?
core
What is your question?
It seems like validation on the "Live Playground" is no longer working. Could you confirm whether or not you are experiencing the same thing?
The text was updated successfully, but these errors were encountered: