diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/edit/QuestionCard.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/edit/QuestionCard.tsx index 7b2b177bf1..5a389b2eaa 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/edit/QuestionCard.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/edit/QuestionCard.tsx @@ -244,24 +244,9 @@ export default function QuestionCard({ { - const trimmedValue = e.target.value.trim(); // Remove spaces from the start and end - const hasInternalSpaces = /\S\s\S/.test(trimmedValue); // Test if there are spaces between words - - if ( - !trimmedValue.includes(" ") && - (trimmedValue === "" || hasInternalSpaces || !/\s/.test(trimmedValue)) - ) { - updateQuestion(questionIdx, { backButtonLabel: trimmedValue }); - } - }} + onChange={(e) => updateQuestion(questionIdx, { buttonLabel: e.target.value })} /> @@ -269,11 +254,6 @@ export default function QuestionCard({ updateQuestion(questionIdx, { backButtonLabel: e.target.value })} - className={cn( - isInValid && - question.backButtonLabel?.trim() === "" && - "border border-red-600 focus:border-red-600" - )} /> )} @@ -284,11 +264,6 @@ export default function QuestionCard({ updateQuestion(questionIdx, { backButtonLabel: e.target.value })} - className={cn( - isInValid && - question.backButtonLabel?.trim() === "" && - "border border-red-600 focus:border-red-600" - )} /> )} diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/edit/Validation.ts b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/edit/Validation.ts index ea9fb1c2af..125098f640 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/edit/Validation.ts +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/edit/Validation.ts @@ -18,11 +18,7 @@ const validationRules = { return question.label.trim() !== ""; }, defaultValidation: (question: TSurveyQuestion) => { - return ( - question.headline.trim() !== "" && - question.buttonLabel?.trim() !== "" && - question.backButtonLabel?.trim() !== "" - ); + return question.headline.trim() !== ""; }, };