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

Playground Validation Not Working #3856

Closed
4 tasks done
pritam-anzilsoft opened this issue Sep 7, 2023 · 1 comment · Fixed by #3858
Closed
4 tasks done

Playground Validation Not Working #3856

pritam-anzilsoft opened this issue Sep 7, 2023 · 1 comment · Fixed by #3858
Assignees
Labels

Comments

@pritam-anzilsoft
Copy link

Prerequisites

What theme are you using?

core

Version

5.x

Current Behavior

In the playground, you've provided a validation schema, but it appears that it's not correctly performing the validation rules for matching the two passwords. Additionally, I couldn't find any properties in the schema or uiSchema to handle these password validations.

Your uiSchema includes the configuration to display the 'pass1' and 'pass2' fields as password input fields, but there seems to be a missing link to the validation logic required for checking if the passwords match.

The playground schema and uiSchema are as follows:

schema = {
"title": "Custom validation",
"description": "This form defines custom validation rules checking that the two passwords match.",
"type": "object",
"properties": {
"pass1": {
"title": "Password",
"type": "string",
"minLength": 3
},
"pass2": {
"title": "Repeat password",
"type": "string",
"minLength": 3
},
"age": {
"title": "Age",
"type": "number",
"minimum": 18
}
}
}

uiSchema = {
"pass1": {
"ui:widget": "password"
},
"pass2": {
"ui:widget": "password"
}
}

Expected Behavior

The system should perform a validation check to ensure that the password matches, and if not, it should display an error message and prevent the form from being submitted.

Steps To Reproduce

1.Please go to Playground.
2.Click on the "Validations" link or button.

Environment

- OS:
- Node:
- npm:

Anything else?

No response

@pritam-anzilsoft pritam-anzilsoft added bug needs triage Initial label given, to be assigned correct labels and assigned labels Sep 7, 2023
@nickgros nickgros self-assigned this Sep 8, 2023
@nickgros nickgros removed the needs triage Initial label given, to be assigned correct labels and assigned label Sep 8, 2023
nickgros added a commit to nickgros/react-jsonschema-form that referenced this issue Sep 8, 2023
- update `validation` example to use RJSF v5 API
- add types for all samples and fix/ignore uncovered type issues
- Spread sample data as extra form props
@pritam-anzilsoft
Copy link
Author

@nickgros I have not observed any changes made to the schema or ui-schema, and the issue still persists.

heath-freenome added a commit that referenced this issue Oct 5, 2023
* [fix] #3856
- update `validation` example to use RJSF v5 API
- add types for all samples and fix/ignore uncovered type issues
- Spread sample data as extra form props

* Changes from code review
- Use ErrorSchemaBuilder
- Deep freeze playground samples
- Remove non-latin1 apostrophes

---------

Co-authored-by: Heath C <51679588+heath-freenome@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants