diff --git a/dashboard/app/(auth)/register/RegisterContent.tsx b/dashboard/app/(auth)/register/RegisterContent.tsx index 0aee1bc..4db57cf 100644 --- a/dashboard/app/(auth)/register/RegisterContent.tsx +++ b/dashboard/app/(auth)/register/RegisterContent.tsx @@ -11,6 +11,7 @@ import { useMemo, useRef, useState, + useId, } from 'react' import { useRouter, useSearchParams } from 'next/navigation' @@ -643,6 +644,7 @@ export default function RegisterContent() { : resendCooldown > 0 ? `${t.form.verificationCodeResend} (${resendCooldown}s)` : t.form.verificationCodeResend + const verificationDescriptionId = useId() return ( -
-
- - -
- {t.form.verificationCodeDescription ? ( -

{t.form.verificationCodeDescription}

- ) : null} -
- {codeDigits.map((digit, index) => ( - { - codeInputRefs.current[index] = element - }} - type="text" - inputMode="numeric" - autoComplete={index === 0 ? 'one-time-code' : undefined} - pattern="[0-9]*" - maxLength={1} - value={digit} - onChange={(event) => handleCodeChange(index, event.target.value)} - onKeyDown={(event) => handleCodeKeyDown(index, event)} - onPaste={(event) => handleCodePaste(index, event)} - disabled={!isVerificationStep} - className="h-12 w-12 rounded-2xl border border-slate-200 bg-white/90 text-center text-lg font-semibold text-slate-900 shadow-sm transition focus:border-sky-500 focus:outline-none focus:ring-2 focus:ring-sky-200 disabled:cursor-not-allowed disabled:bg-slate-100 disabled:text-slate-400" - aria-label={`${t.form.verificationCodeLabel} ${index + 1}`} - /> - ))} -
-
+
+
+ + +
+ {t.form.verificationCodeDescription ? ( +

+ {t.form.verificationCodeDescription} +

+ ) : null} +
+ {codeDigits.map((digit, index) => ( + { + codeInputRefs.current[index] = element + }} + type="text" + inputMode="numeric" + autoComplete={index === 0 ? 'one-time-code' : undefined} + pattern="[0-9]*" + maxLength={1} + value={digit} + onChange={(event) => handleCodeChange(index, event.target.value)} + onKeyDown={(event) => handleCodeKeyDown(index, event)} + onPaste={(event) => handleCodePaste(index, event)} + className="h-12 w-12 rounded-2xl border border-slate-200 bg-white/90 text-center text-lg font-semibold text-slate-900 shadow-sm transition focus:border-sky-500 focus:outline-none focus:ring-2 focus:ring-sky-200 disabled:cursor-not-allowed disabled:bg-slate-100 disabled:text-slate-400" + aria-label={`${t.form.verificationCodeLabel} ${index + 1}`} + aria-describedby={ + t.form.verificationCodeDescription ? verificationDescriptionId : undefined + } + /> + ))} +
+