Skip to content

Commit

Permalink
Merge pull request #7790 from surveyjs/bug/7783-below-header-setting
Browse files Browse the repository at this point in the history
Fixed #7783 - The "showProgressBar": "belowHeader" setting doesn't work
  • Loading branch information
OlgaLarina authored Feb 2, 2024
2 parents aa2cf6f + 0c7c3cf commit 21575d1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/survey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7519,6 +7519,9 @@ export class SurveyModel extends SurveyElementCore
if (isStrCiEqual(this.showProgressBar, "aboveHeader")) {
isBelowHeader = false;
}
if (isStrCiEqual(this.showProgressBar, "belowHeader")) {
isBelowHeader = true;
}
if (container === "header" && !isBelowHeader) {
layoutElement.index = -150;
if (this.isShowProgressBarOnTop && !this.isShowStartingPage) {
Expand Down
17 changes: 16 additions & 1 deletion tests/surveytests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18778,11 +18778,26 @@ QUnit.test("getContainerContent - progress + advanced header (legacyProgressBarV
assert.deepEqual(getContainerContent("left"), [], "progress top left");
assert.deepEqual(getContainerContent("right"), [], "progress top right");

survey.showProgressBar = "belowHeader";
assert.deepEqual(getContainerContent("header"), [{
"component": "sv-header",
"container": "header",
"id": "advanced-header",
"index": -100
}], "progress top header");
assert.deepEqual(getContainerContent("center"), [{
"component": "sv-progress-pages",
"id": "progress-pages",
}], "progress top center");
assert.deepEqual(getContainerContent("footer"), [], "progress top footer");
assert.deepEqual(getContainerContent("contentTop"), [], "progress top contentTop");
assert.deepEqual(getContainerContent("contentBottom"), [], "progress top contentBottom");
assert.deepEqual(getContainerContent("left"), [], "progress top left");
assert.deepEqual(getContainerContent("right"), [], "progress top right");
}
finally {
settings.legacyProgressBarView = false;
}

});

QUnit.test("getContainerContent - progress + advanced header", function (assert) {
Expand Down

0 comments on commit 21575d1

Please sign in to comment.