-
Couldn't load subscription status.
- Fork 2.3k
Feature: Performance optimization, live validate/omit onBlur #4812
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
Feature: Performance optimization, live validate/omit onBlur #4812
Conversation
8ad2870 to
e98ce8d
Compare
Added support to make live validate and live omit work during the `onBlur` phase rather than `onChange` - In `@rjsf/core`: - Updated `FormProps` to add new `onChange`/`onBlur` values for the `liveValidate` and `liveOmit` props, deprecating the `boolean` aspect of them - Updated `Form` to support the new feature to do `onBlur` handling of `liveValidate` and `liveOmit` - Updated the tests to verify the new behavior - Updated the playground to switch `liveValidate` and `liveOmit` from checkboxes to radio buttons for the new options - Updated `form-props.md` and `v6x upgrade guide.md` to document the new feature and deprecation - Updated the `CHANGELOG.md` accordingly
e98ce8d to
a5202c6
Compare
| @@ -3716,13 +3719,192 @@ describeRepeated('Form common', (createFormComponent) => { | |||
| }); | |||
| }); | |||
|
|
|||
| describe('Form omitExtraData and liveOmit', () => { | |||
| describe('Live validation onBlur', () => { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is one set of new tests
|
|
||
| describe('omitExtraData and live omit onBlur', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the other set of new tests
|
|
||
| describe('Form omitExtraData and liveOmit', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything else from here down is just a reorganization. Hiding whitespace will help reduce a lot of changed lines
Reasons for making this change
Added support to make live validate and live omit work during the
onBlurphase rather thanonChange@rjsf/core:FormPropsto add newonChange/onBlurvalues for theliveValidateandliveOmitprops, deprecating thebooleanaspect of themFormto support the new feature to doonBlurhandling ofliveValidateandliveOmitliveValidateandliveOmitfrom checkboxes to radio buttons for the new optionsform-props.mdandv6x upgrade guide.mdto document the new feature and deprecationCHANGELOG.mdaccordinglyChecklist
npx nx run-many --target=build --exclude=@rjsf/docs && npm run test:updateto update snapshots, if needed.Updated playground controls: