File tree Expand file tree Collapse file tree
src/react/src/components/InitialClaimFlow/ClaimForm Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { useFormik } from 'formik';
33import { isEmpty } from 'lodash' ;
44import { getValidationSchemaForStep } from './validationSchemas' ;
55import { claimIntroRoute } from '../../../util/constants' ;
6+ import { CLAIM_FORM_STEPS } from './constants' ;
67
78export const usePrefetchClaimData = (
89 fetchCountries ,
@@ -128,6 +129,23 @@ export const useClaimForm = (
128129 field => formik . errors [ field ] ,
129130 ) ;
130131
132+ // Check if select field has a value selected
133+ const noSelectedOption = currentStepFields . some ( field => {
134+ const value = formik . values [ field ] ;
135+
136+ if ( value && value !== '' ) {
137+ return false ;
138+ }
139+
140+ return true ;
141+ } ) ;
142+
143+ // For eligibility step, only check errors and no selected option
144+ if ( activeStep === CLAIM_FORM_STEPS . ELIGIBILITY ) {
145+ return hasCurrentStepErrors || noSelectedOption ;
146+ }
147+
148+ // For other steps, only check if user has interacted and has errors
131149 return hasInteractedWithCurrentStep && hasCurrentStepErrors ;
132150 } ;
133151
You can’t perform that action at this time.
0 commit comments