Skip to content

Commit

Permalink
Remove key warning
Browse files Browse the repository at this point in the history
  • Loading branch information
ssoonmi committed Nov 21, 2023
1 parent bf7181b commit e205c70
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions frontend/src/scenes/surveys/SurveyAppearance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -530,13 +530,13 @@ const OpenEndedChoice = ({
label,
initialChecked,
inputType,
key,
index,
}: {
label: string
initialChecked: boolean
inputType: string
textColor: string
key: number
index: number
}): JSX.Element => {
const textRef = useRef<HTMLInputElement | null>(null)
const checkRef = useRef<HTMLInputElement | null>(null)
Expand All @@ -551,14 +551,14 @@ const OpenEndedChoice = ({
}}
>
<input
id={`${label}-${key}`}
id={`${label}-${index}`}
ref={checkRef}
type={inputType}
disabled={!initialChecked || !checkRef.current?.value}
defaultChecked={initialChecked}
name="choice"
/>
<label htmlFor={`${label}-${key}`}>
<label htmlFor={`${label}-${index}`}>
<span>{label}:</span>
<input
ref={textRef}
Expand Down Expand Up @@ -647,6 +647,7 @@ export function SurveyMultipleChoiceAppearance({
idx === multipleChoiceQuestion.choices?.length - 1 ? (
<OpenEndedChoice
key={idx}
index={idx}
initialChecked={!!initialChecked?.includes(idx)}
inputType={inputType}
label={choice}
Expand Down

0 comments on commit e205c70

Please sign in to comment.