Skip to content

Commit

Permalink
e.toLowerCase is not a function on setting to survey.showProgressBar …
Browse files Browse the repository at this point in the history
…boolean value fix #6459
andrewtelnov committed Jan 29, 2025
1 parent 5bee3cd commit db29abd
Showing 2 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/survey-core/src/survey.ts
Original file line number Diff line number Diff line change
@@ -2822,6 +2822,8 @@ export class SurveyModel extends SurveyElementCore
return this.getPropertyValue("showProgressBar");
}
public set showProgressBar(newValue: string) {
if((<any>newValue) === true) newValue = "auto";
if((<any>newValue) === false) newValue = "off";
this.setPropertyValue("showProgressBar", newValue.toLowerCase());
}
/**
19 changes: 19 additions & 0 deletions packages/survey-core/tests/surveytests.ts
Original file line number Diff line number Diff line change
@@ -20684,6 +20684,25 @@ QUnit.test("getContainerContent - do not show buttons progress in the single pag
assert.deepEqual(getContainerContent("left"), [], "");
assert.deepEqual(getContainerContent("right"), [], "");
});
QUnit.test("getContainerContent - do not show buttons progress in the single page mode", function (assert) {
const survey = new SurveyModel({
showProgressBar: true,
progressBarLocation: "bottom",
pages: [
{
"elements": [
{
"type": "text",
"name": "q1",
},
]
},
]
});
assert.equal(survey.showProgressBar, "auto");
(<any>survey).showProgressBar = false;
assert.equal(survey.showProgressBar, "off");
});
QUnit.test("Display mode in design time 2", function (assert) {
const survey = new SurveyModel();
assert.equal(survey.wrapperFormCss, "sd-root-modern__wrapper");

0 comments on commit db29abd

Please sign in to comment.