added tabindex

This commit is contained in:
joyal007
2023-10-04 09:22:20 +05:30
parent a2128d2a66
commit 080ddb6f48

View File

@@ -36,7 +36,14 @@ export default function ConsentQuestion({
e.preventDefault();
onSubmit({ [question.id]: value });
}}>
<label className="relative z-10 mt-4 flex w-full cursor-pointer items-center rounded-md border border-gray-200 bg-slate-50 p-4 text-sm text-slate-800 focus:outline-none">
<label
tabIndex={1}
onKeyDown={(e) => {
if (e.key == "Enter") {
onChange({ [question.id]: "accepted" });
}
}}
className="relative z-10 mt-4 flex w-full cursor-pointer items-center rounded-md border border-gray-200 bg-slate-50 p-4 text-sm text-slate-800 focus:outline-none focus:ring-2 focus:ring-slate-500 focus:ring-offset-2">
<input
type="checkbox"
id={question.id}
@@ -62,10 +69,11 @@ export default function ConsentQuestion({
<div className="mt-4 flex w-full justify-between">
{!isFirstQuestion && (
<BackButton backButtonLabel={question.backButtonLabel} onClick={() => onBack()} />
<BackButton tabIndex={3} backButtonLabel={question.backButtonLabel} onClick={() => onBack()} />
)}
<div />
<SubmitButton
tabIndex={2}
brandColor={brandColor}
question={question}
isLastQuestion={isLastQuestion}