updated tabindex

This commit is contained in:
joyal007
2023-10-04 09:22:55 +05:30
parent 080ddb6f48
commit b6ed2e6530
@@ -79,7 +79,7 @@ export default function MultipleChoiceSingleQuestion({
}}
className={cn(
value === choice.label ? "z-10 border-slate-400 bg-slate-50" : "border-gray-200",
"relative flex cursor-pointer flex-col rounded-md border p-4 text-slate-800 focus-within:border-slate-400 focus-within:bg-slate-50 hover:bg-slate-50 focus:outline-none focus:[&>input]:ring-0 focus:[&>input]:ring-offset-0"
"relative flex cursor-pointer flex-col rounded-md border p-4 text-slate-800 focus-within:border-slate-400 focus-within:bg-slate-50 hover:bg-slate-50 focus:outline-none "
)}>
<span className="flex items-center text-sm">
<input
@@ -105,15 +105,21 @@ export default function MultipleChoiceSingleQuestion({
))}
{otherOption && (
<label
tabIndex={questionChoices.length + 1}
className={cn(
value === otherOption.label ? "z-10 border-slate-400 bg-slate-50" : "border-gray-200",
"relative flex cursor-pointer flex-col rounded-md border p-4 text-slate-800 hover:bg-slate-50 focus:outline-none"
)}>
"relative flex cursor-pointer flex-col rounded-md border p-4 text-slate-800 focus-within:border-slate-400 focus-within:bg-slate-50 hover:bg-slate-50 focus:outline-none"
)}
onKeyDown={(e) => {
if (e.key == "Enter") {
setOtherSelected(!otherSelected);
onChange({ [question.id]: "" });
}
}}>
<span className="flex items-center text-sm">
<input
type="radio"
id={otherOption.id}
tabIndex={questionChoices.length + 1}
name={question.id}
value={otherOption.label}
className="h-4 w-4 border border-slate-300 focus:ring-0 focus:ring-offset-0"
@@ -132,6 +138,7 @@ export default function MultipleChoiceSingleQuestion({
{otherSelected && (
<input
ref={otherSpecify}
tabIndex={questionChoices.length + 1}
id={`${otherOption.id}-label`}
name={question.id}
value={value}