Skip to content

Commit

Permalink
fix: Survey's placeholder customization not showing up (#27089)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasheriques authored Dec 20, 2024
1 parent 36bf03e commit 18198bb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
6 changes: 5 additions & 1 deletion frontend/src/scenes/surveys/SurveyCustomization.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,11 @@ export function Customization({
<>
<LemonField.Pure className="mt-2" label="Placeholder text">
<LemonInput
value={appearance?.placeholder || defaultSurveyAppearance.placeholder}
value={
appearance?.placeholder !== undefined
? appearance.placeholder
: defaultSurveyAppearance.placeholder
}
onChange={(placeholder) => onAppearanceChange({ ...appearance, placeholder })}
disabled={!surveysStylingAvailable}
/>
Expand Down
15 changes: 7 additions & 8 deletions frontend/src/scenes/surveys/SurveyEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
}}
Expand Down

0 comments on commit 18198bb

Please sign in to comment.