fix: next button tweak (#1903)

This commit is contained in:
Dhruwang Jariwala
2024-01-16 15:04:44 +05:30
committed by GitHub
parent be4534da2d
commit 81e9ac0e12
@@ -101,6 +101,7 @@ export default function QuestionCard({
const updateEmptyNextButtonLabels = (labelValue: string) => {
localSurvey.questions.forEach((q, index) => {
if (index === localSurvey.questions.length - 1) return;
if (!q.buttonLabel || q.buttonLabel?.trim() === "") {
updateQuestion(index, { buttonLabel: labelValue });
}
@@ -319,6 +320,8 @@ export default function QuestionCard({
updateQuestion(questionIdx, { buttonLabel: e.target.value });
}}
onBlur={(e) => {
//If it is the last question then do not update labels
if (questionIdx === localSurvey.questions.length - 1) return;
updateEmptyNextButtonLabels(e.target.value);
}}
/>