@@ -35,6 +35,7 @@ import {
3535 ValidatorType ,
3636 Experimental_DefaultFormStateBehavior ,
3737 Experimental_CustomMergeAllOf ,
38+ // FormValidation,
3839} from '@rjsf/utils' ;
3940import _forEach from 'lodash/forEach' ;
4041import _get from 'lodash/get' ;
@@ -274,6 +275,8 @@ export default class Form<
274275 */
275276 formElement : RefObject < any > ;
276277
278+ private customValidationErrors : RJSFValidationError [ ] = [ ] ;
279+
277280 /** Constructs the `Form` from the `props`. Will setup the initial state from the props. It will also call the
278281 * `onChange` handler if the initially provided `formData` is modified to add missing default values as part of the
279282 * state construction.
@@ -519,6 +522,10 @@ export default class Form<
519522 return shouldRender ( this , nextProps , nextState ) ;
520523 }
521524
525+ // private customValidateCB = (formData: T | undefined, errors: FormValidation<T>, uiSchema?: UiSchema<T, S, F>): FormValidation<T> => {
526+ // const errorHandler = customValidate(newFormData, createErrorHandler<T>(newFormData), uiSchema);
527+ // };
528+
522529 /** Validates the `formData` against the `schema` using the `altSchemaUtils` (if provided otherwise it uses the
523530 * `schemaUtils` in the state), returning the results.
524531 *
@@ -703,8 +710,12 @@ export default class Form<
703710 errors = merged . errors ;
704711 }
705712 // Merging 'newErrorSchema' into 'errorSchema' to display the custom raised errors.
713+ console . log ( 'newErrorSchema****' , newErrorSchema ) ;
706714 if ( newErrorSchema ) {
707715 const filteredErrors = this . filterErrorsBasedOnSchema ( newErrorSchema , retrievedSchema , newFormData ) ;
716+ console . log ( 'filteredErrors' , filteredErrors ) ;
717+ console . log ( 'newFormData' , newFormData ) ;
718+ console . log ( 'filteredErrors formData' , formData ) ;
708719 errorSchema = mergeObjects ( errorSchema , filteredErrors , 'preventDuplicates' ) as ErrorSchema < T > ;
709720 }
710721 state = {
0 commit comments