From 0c7c3cff378a054d910a9c2fcf2a6516d02a9a84 Mon Sep 17 00:00:00 2001 From: tsv2013 Date: Thu, 1 Feb 2024 18:53:33 +0300 Subject: [PATCH] Fixed #7783 - The "showProgressBar": "belowHeader" setting doesn't work --- src/survey.ts | 5 ++++- tests/surveytests.ts | 17 ++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/survey.ts b/src/survey.ts index b0684a777b..37e7dc3ad0 100644 --- a/src/survey.ts +++ b/src/survey.ts @@ -6058,7 +6058,7 @@ export class SurveyModel extends SurveyElementCore } startLoadingFromJson(json?: any): void { super.startLoadingFromJson(json); - if(json && json.locale) { + if (json && json.locale) { this.locale = json.locale; } } @@ -7490,6 +7490,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) { diff --git a/tests/surveytests.ts b/tests/surveytests.ts index e62c3250ce..d08876ede1 100644 --- a/tests/surveytests.ts +++ b/tests/surveytests.ts @@ -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) {