Skip to content

Commit

Permalink
question.hasDescription doesn't calculate correctly on adding new que…
Browse files Browse the repository at this point in the history
…stion fix #6922 (#6923)
  • Loading branch information
andrewtelnov committed Sep 10, 2023
1 parent 913f4b2 commit 5e163fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/survey-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ export class SurveyElement<E = any> extends SurveyElementCore implements ISurvey
this.onSetData();
}
if (!!this.survey) {
this.updateDescriptionVisibility(this.description);
this.clearCssClasses();
}
}
Expand Down
4 changes: 4 additions & 0 deletions tests/surveytests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16218,6 +16218,10 @@ QUnit.test("hasDescription is isDesignMode", function (assert) {
const q2 = survey.getQuestionByName("q2");
assert.notOk(q1.hasDescription, "text description is not shown");
assert.ok(q2.hasDescription, "comment description is shown");
const q3 = survey.currentPage.addNewQuestion("text", "q3");
const q4 = survey.currentPage.addNewQuestion("comment", "q4");
assert.notOk(q3.hasDescription, "text description is not shown, on adding question");
assert.ok(q4.hasDescription, "comment description is shown, on adding question");

commentDescriptionProperty.placeholder = oldValue;
settings.supportCreatorV2 = false;
Expand Down

0 comments on commit 5e163fd

Please sign in to comment.