File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -56,14 +56,14 @@ type BaseFormProps<Values> = Omit<FormikConfig<Values>, "children"> & {
56
56
children : ReactNode | ( ( props : _FormikProps < Values > ) => ReactNode )
57
57
scrollIntoViewOptions ?: ScrollIntoViewOptions
58
58
nonFieldErrorsProps ?: Omit < NonFieldErrorsProps , "children" >
59
- order ?: Array < { name : string ; inputRef : RefObject < HTMLInputElement > } >
59
+ fieldRefs ?: Array < { name : string ; inputRef : RefObject < HTMLInputElement > } >
60
60
}
61
61
62
62
const BaseForm = < Values extends FormValues > ( {
63
63
children,
64
64
scrollIntoViewOptions = SCROLL_INTO_VIEW_OPTIONS ,
65
65
nonFieldErrorsProps,
66
- order ,
66
+ fieldRefs ,
67
67
...otherFormikProps
68
68
} : BaseFormProps < Values > ) => (
69
69
< Formik { ...otherFormikProps } >
@@ -79,10 +79,10 @@ const BaseForm = <Values extends FormValues>({
79
79
)
80
80
}
81
81
// If a submission was attempted and refs to the fields were provided.
82
- else if ( formik . isSubmitting && order && order . length ) {
82
+ else if ( formik . isSubmitting && fieldRefs && fieldRefs . length ) {
83
83
const errorNames = getKeyPaths ( formik . errors )
84
84
85
- const inputRef = order . find ( ( { name } ) =>
85
+ const inputRef = fieldRefs . find ( ( { name } ) =>
86
86
errorNames . includes ( name ) ,
87
87
) ?. inputRef
88
88
You can’t perform that action at this time.
0 commit comments