From 18198bbf5f17e93fa05290e40d66acc7eb8c21e5 Mon Sep 17 00:00:00 2001 From: Lucas Faria <12522524+lucasheriques@users.noreply.github.com> Date: Fri, 20 Dec 2024 17:04:26 -0300 Subject: [PATCH] fix: Survey's placeholder customization not showing up (#27089) --- .../src/scenes/surveys/SurveyCustomization.tsx | 6 +++++- frontend/src/scenes/surveys/SurveyEdit.tsx | 15 +++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/frontend/src/scenes/surveys/SurveyCustomization.tsx b/frontend/src/scenes/surveys/SurveyCustomization.tsx index c6fe0b0cbeb4f..ccbe34146a922 100644 --- a/frontend/src/scenes/surveys/SurveyCustomization.tsx +++ b/frontend/src/scenes/surveys/SurveyCustomization.tsx @@ -137,7 +137,11 @@ export function Customization({ <> onAppearanceChange({ ...appearance, placeholder })} disabled={!surveysStylingAvailable} /> diff --git a/frontend/src/scenes/surveys/SurveyEdit.tsx b/frontend/src/scenes/surveys/SurveyEdit.tsx index b25fce787d71f..776a7e25c1409 100644 --- a/frontend/src/scenes/surveys/SurveyEdit.tsx +++ b/frontend/src/scenes/surveys/SurveyEdit.tsx @@ -2,8 +2,7 @@ import './EditSurvey.scss' import { DndContext } from '@dnd-kit/core' import { SortableContext, verticalListSortingStrategy } from '@dnd-kit/sortable' -import { IconInfo } from '@posthog/icons' -import { IconLock, IconPlus, IconTrash } from '@posthog/icons' +import { IconInfo, IconLock, IconPlus, IconTrash } from '@posthog/icons' import { LemonButton, LemonCalendarSelect, @@ -538,12 +537,12 @@ export default function SurveyEdit(): JSX.Element { appearance={value || defaultSurveyAppearance} hasBranchingLogic={hasBranchingLogic} deleteBranchingLogic={deleteBranchingLogic} - customizeRatingButtons={ - survey.questions[0].type === SurveyQuestionType.Rating - } - customizePlaceholderText={ - survey.questions[0].type === SurveyQuestionType.Open - } + customizeRatingButtons={survey.questions.some( + (question) => question.type === SurveyQuestionType.Rating + )} + customizePlaceholderText={survey.questions.some( + (question) => question.type === SurveyQuestionType.Open + )} onAppearanceChange={(appearance) => { onChange(appearance) }}