diff --git a/src/survey.ts b/src/survey.ts index 98653ca890..d28d2353d6 100644 --- a/src/survey.ts +++ b/src/survey.ts @@ -904,7 +904,7 @@ export class SurveyModel extends SurveyElementCore } ); this.registerPropertyChangedHandlers( - ["isLoading", "isCompleted", "isCompletedBefore", "mode", "isStartedState", "currentPage"], + ["isLoading", "isCompleted", "isCompletedBefore", "mode", "isStartedState", "currentPage", "isShowingPreview"], () => { this.updateState(); }); this.registerPropertyChangedHandlers(["state", "currentPage", "showPreviewBeforeComplete"], () => { this.onStateAndCurrentPageChanged(); }); diff --git a/tests/question_texttests.ts b/tests/question_texttests.ts index 70d92ffc57..3ecd4d8164 100644 --- a/tests/question_texttests.ts +++ b/tests/question_texttests.ts @@ -84,6 +84,23 @@ QUnit.test("Test renderedPlaceholder on locale change", function(assert) { assert.equal(q2.renderedPlaceholder, "comment_de", "text, locale de"); survey.locale = ""; }); +QUnit.test("Test renderedPlaceholder on locale change, bug#7911", function(assert) { + const survey = new SurveyModel({ + elements: [ + { + name: "q1", + type: "text", + placeholder: "my text" + } + ] + }); + survey.showPreview(); + let q1 = survey.getQuestionByName("q1"); + assert.notOk(q1.renderedPlaceholder, "#1"); + survey.cancelPreview(); + q1 = survey.getQuestionByName("q1"); + assert.equal(q1.renderedPlaceholder, "my text", "#2"); +}); QUnit.test("Test renderedPlaceholder on locale change", function(assert) { const survey = new SurveyModel({ "elements": [ @@ -102,6 +119,7 @@ QUnit.test("Test renderedPlaceholder on locale change", function(assert) { const q1 = survey.getAllQuestions()[0]; assert.equal(q1.renderedPlaceholder, "Spanish", "text, locale es"); }); + QUnit.test("min date error text, bug #4596", function(assert) { const survey = new SurveyModel({ elements: [{ type: "text", name: "q1", inputType: "date", min: "2000-10-10" }]