File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 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"> & {
5656 children : ReactNode | ( ( props : _FormikProps < Values > ) => ReactNode )
5757 scrollIntoViewOptions ?: ScrollIntoViewOptions
5858 nonFieldErrorsProps ?: Omit < NonFieldErrorsProps , "children" >
59- order ?: Array < { name : string ; inputRef : RefObject < HTMLInputElement > } >
59+ fieldRefs ?: Array < { name : string ; inputRef : RefObject < HTMLInputElement > } >
6060}
6161
6262const BaseForm = < Values extends FormValues > ( {
6363 children,
6464 scrollIntoViewOptions = SCROLL_INTO_VIEW_OPTIONS ,
6565 nonFieldErrorsProps,
66- order ,
66+ fieldRefs ,
6767 ...otherFormikProps
6868} : BaseFormProps < Values > ) => (
6969 < Formik { ...otherFormikProps } >
@@ -79,10 +79,10 @@ const BaseForm = <Values extends FormValues>({
7979 )
8080 }
8181 // 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 ) {
8383 const errorNames = getKeyPaths ( formik . errors )
8484
85- const inputRef = order . find ( ( { name } ) =>
85+ const inputRef = fieldRefs . find ( ( { name } ) =>
8686 errorNames . includes ( name ) ,
8787 ) ?. inputRef
8888
You can’t perform that action at this time.
0 commit comments