Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed https://github.com/surveyjs/survey-creator/issues/4939 - A survey header is not reset when switching from Basic to Advanced #7446

Merged
merged 3 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/survey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7417,7 +7417,6 @@ export class SurveyModel extends SurveyElementCore
const advHeader = new Cover();
advHeader.fromTheme(theme);
this.insertAdvancedHeader(advHeader);
this.headerView = "advanced";
}
if (key === "isPanelless") {
this.isCompact = theme[key];
Expand Down
8 changes: 7 additions & 1 deletion tests/surveytests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18366,6 +18366,12 @@ QUnit.test("Do not run defaultValueExpression on survey.data, #7423", function (
assert.deepEqual(q3.value, [], "q3.value #3");
assert.notOk(q4.value, "q4.value #3");
});
QUnit.test("theme assignment doesn't affect headerView", function (assert) {
let survey = new SurveyModel({});
assert.equal(survey.headerView, "basic", "default value");
survey.theme = { header: {} } as any;
assert.equal(survey.headerView, "basic", "keep default value");
});
QUnit.test("defaultValueExpression expression stops working after survey.clear(), #7448", function (assert) {
const survey = new SurveyModel({
elements: [
Expand All @@ -18385,4 +18391,4 @@ QUnit.test("defaultValueExpression expression stops working after survey.clear()
survey.clear();
q1.value = 4;
assert.equal(q2.value, 4, "defaultValueExpression is working after set value directly & clear");
});
});