@@ -135,16 +135,17 @@ const BasicInfo = (): JSX.Element => {
135135 ) ;
136136
137137 const handleFieldChange = useCallback (
138- ( field : keyof BasicInfoFormData , nextAction ?: ( ) => void ) => ( value : string ) => {
139- const currentValue = formData [ field ] ;
140- const isAutofill = value . length - currentValue . length > 1 ;
138+ ( field : keyof BasicInfoFormData , nextAction ?: ( ) => void ) =>
139+ ( value : string ) => {
140+ const currentValue = formData [ field ] ;
141+ const isAutofill = value . length - currentValue . length > 1 ;
141142
142- handleFormDataChange ( field ) ( value ) ;
143+ handleFormDataChange ( field ) ( value ) ;
143144
144- if ( isAutofill && nextAction ) {
145- nextAction ( ) ;
146- }
147- } ,
145+ if ( isAutofill && nextAction ) {
146+ nextAction ( ) ;
147+ }
148+ } ,
148149 [ formData , handleFormDataChange ] ,
149150 ) ;
150151
@@ -166,7 +167,10 @@ const BasicInfo = (): JSX.Element => {
166167 label = { strings ( 'deposit.basic_info.first_name' ) }
167168 placeholder = "John"
168169 value = { formData . firstName }
169- onChangeText = { handleFieldChange ( 'firstName' , focusNextField ( lastNameInputRef ) ) }
170+ onChangeText = { handleFieldChange (
171+ 'firstName' ,
172+ focusNextField ( lastNameInputRef ) ,
173+ ) }
170174 error = { errors . firstName }
171175 returnKeyType = "next"
172176 testID = "first-name-input"
@@ -182,7 +186,10 @@ const BasicInfo = (): JSX.Element => {
182186 label = { strings ( 'deposit.basic_info.last_name' ) }
183187 placeholder = "Smith"
184188 value = { formData . lastName }
185- onChangeText = { handleFieldChange ( 'lastName' , focusNextField ( phoneInputRef ) ) }
189+ onChangeText = { handleFieldChange (
190+ 'lastName' ,
191+ focusNextField ( phoneInputRef ) ,
192+ ) }
186193 error = { errors . lastName }
187194 returnKeyType = "next"
188195 testID = "last-name-input"
@@ -198,7 +205,10 @@ const BasicInfo = (): JSX.Element => {
198205 < DepositPhoneField
199206 label = { strings ( 'deposit.basic_info.phone_number' ) }
200207 value = { formData . mobileNumber }
201- onChangeText = { handleFieldChange ( 'mobileNumber' , focusNextField ( dateInputRef ) ) }
208+ onChangeText = { handleFieldChange (
209+ 'mobileNumber' ,
210+ focusNextField ( dateInputRef ) ,
211+ ) }
202212 error = { errors . mobileNumber }
203213 ref = { phoneInputRef }
204214 onSubmitEditing = { focusNextField ( dateInputRef ) }
@@ -232,10 +242,7 @@ const BasicInfo = (): JSX.Element => {
232242 label = { strings ( 'deposit.basic_info.social_security_number' ) }
233243 placeholder = "XXX-XX-XXXX"
234244 value = { formData . ssn }
235- onChangeText = { handleFieldChange ( 'ssn' , ( ) => {
236- Keyboard . dismiss ( ) ;
237- handleOnPressContinue ( ) ;
238- } ) }
245+ onChangeText = { handleFieldChange ( 'ssn' ) }
239246 error = { errors . ssn }
240247 returnKeyType = "done"
241248 testID = "ssn-input"
@@ -247,7 +254,6 @@ const BasicInfo = (): JSX.Element => {
247254 maxLength = { 11 }
248255 onSubmitEditing = { ( ) => {
249256 Keyboard . dismiss ( ) ;
250- handleOnPressContinue ( ) ;
251257 } }
252258 />
253259 ) }
0 commit comments