Skip to content

Commit

Permalink
chore: removed log
Browse files Browse the repository at this point in the history
  • Loading branch information
Balastrong committed Apr 20, 2024
1 parent 61dc097 commit 4000092
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/components/survey-generator/create-survey.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ export const CreateSurvey = () => {
};

form.pushFieldValue("questions", newQuestion);
console.log(form.state.values);
};

const onShowClick = () => {
Expand Down
12 changes: 8 additions & 4 deletions src/components/survey-generator/question-blocks/choice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,12 @@ export const ChoiceFormField = ({ questionIndex, form }: Props) => {
size="sm"
className="w-[150px] justify-start"
>
<selectedVariant.icon className="mr-2 h-4 w-4 shrink-0" />
{selectedVariant.label}
{selectedVariant && (
<>
<selectedVariant.icon className="mr-2 h-4 w-4 shrink-0" />
{selectedVariant.label}
</>
)}
</Button>
</PopoverTrigger>
<PopoverContent className="p-0" align="start">
Expand Down Expand Up @@ -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)}
/>
</QuestionCardItem>
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 4000092

Please sign in to comment.