1
1
"use client" ;
2
- import React , { useEffect , useState , useRef , useCallback } from "react" ;
2
+ import React , { useEffect , useState , useCallback } from "react" ;
3
3
import { withFormik } from "formik" ;
4
4
import { getFormInitialValues } from "@lib/formBuilder" ;
5
5
import { getErrorList , setFocusOnErrorMessage , validateOnSubmit } from "@lib/validation/validation" ;
@@ -36,6 +36,8 @@ import { FormStatus } from "@gcforms/types";
36
36
import { CaptchaFail } from "@clientComponents/globals/FormCaptcha/CaptchaFail" ;
37
37
import { ga } from "@lib/client/clientHelpers" ;
38
38
39
+ import { FocusHeader } from "app/(gcforms)/[locale]/(support)/components/client/FocusHeader" ;
40
+
39
41
/**
40
42
* This is the "inner" form component that isn't connected to Formik and just renders a simple form
41
43
* @param props
@@ -59,7 +61,6 @@ const InnerForm: React.FC<InnerFormProps> = (props) => {
59
61
const isGroupsCheck = groupsCheck ( props . allowGrouping ) ;
60
62
const isShowReviewPage = showReviewPage ( form ) ;
61
63
const showIntro = isGroupsCheck ? currentGroup === LockedSections . START : true ;
62
- const groupsHeadingRef = useRef < HTMLHeadingElement > ( null ) ;
63
64
const { getFormDelayWithGroups, getFormDelayWithoutGroups } = useFormDelay ( ) ;
64
65
65
66
// Used to set any values we'd like added for use in the below withFormik handleSubmit().
@@ -181,9 +182,9 @@ const InnerForm: React.FC<InnerFormProps> = (props) => {
181
182
isShowReviewPage &&
182
183
currentGroup !== LockedSections . REVIEW &&
183
184
currentGroup !== LockedSections . START && (
184
- < h2 tabIndex = { - 1 } ref = { groupsHeadingRef } >
185
+ < FocusHeader headingTag = "h2" >
185
186
{ getGroupTitle ( currentGroup , language as Language ) }
186
- </ h2 >
187
+ </ FocusHeader >
187
188
) }
188
189
189
190
{ children }
0 commit comments