diff --git a/src/components/survey-generator/create-survey.tsx b/src/components/survey-generator/create-survey.tsx index af0ec2b..51a4908 100644 --- a/src/components/survey-generator/create-survey.tsx +++ b/src/components/survey-generator/create-survey.tsx @@ -76,7 +76,6 @@ export const CreateSurvey = () => { }; form.pushFieldValue("questions", newQuestion); - console.log(form.state.values); }; const onShowClick = () => { diff --git a/src/components/survey-generator/question-blocks/choice.tsx b/src/components/survey-generator/question-blocks/choice.tsx index 1419987..2f971dc 100644 --- a/src/components/survey-generator/question-blocks/choice.tsx +++ b/src/components/survey-generator/question-blocks/choice.tsx @@ -87,8 +87,12 @@ export const ChoiceFormField = ({ questionIndex, form }: Props) => { size="sm" className="w-[150px] justify-start" > - - {selectedVariant.label} + {selectedVariant && ( + <> + + {selectedVariant.label} + + )} @@ -125,7 +129,7 @@ export const ChoiceFormField = ({ questionIndex, form }: Props) => { placeholder="Question" className="text-md" name={field.name} - value={field.state.value} + value={field.state.value ?? ""} onChange={(e) => field.handleChange(e.target.value)} /> @@ -161,7 +165,7 @@ export const ChoiceFormField = ({ questionIndex, form }: Props) => { type="text" placeholder="Option" name={subField.name} - value={subField.state.value} + value={subField.state.value ?? ""} onChange={(e) => subField.handleChange(e.target.value as never) }