diff --git a/website/src/components/Survey/LabelRadioGroup.tsx b/website/src/components/Survey/LabelRadioGroup.tsx index 9cae671a..918976ed 100644 --- a/website/src/components/Survey/LabelRadioGroup.tsx +++ b/website/src/components/Survey/LabelRadioGroup.tsx @@ -10,6 +10,7 @@ interface LabelRadioGroupProps { export const LabelRadioGroup = (props: LabelRadioGroupProps) => { const [labelValues, setLabelValues] = useState(Array.from({ length: props.labelIDs.length }).map(() => 0)); + const [interactionFlag, setInteractionFlag] = useState(false); return ( @@ -23,12 +24,14 @@ export const LabelRadioGroup = (props: LabelRadioGroupProps) => { newState[idx] = newValue; props.onChange(labelValues); setLabelValues(newState); + if (!interactionFlag) setInteractionFlag(true); }} states={[ { text: "No", value: 0 }, { text: "Yes", value: 1 }, ]} isDisabled={props.isDisabled} + interactionFlag={interactionFlag} /> ))} @@ -47,6 +50,7 @@ interface LabelRadioItemProps { clickHandler: (newVal: number) => unknown; states: ButtonState[]; isDisabled: boolean; + interactionFlag: boolean; } const LabelRadioItem = (props: LabelRadioItemProps) => { @@ -64,7 +68,7 @@ const LabelRadioItem = (props: LabelRadioItemProps) => { {props.states.map((item, idx) => (