Skip to content

Commit

Permalink
The SurveyModel.progressValue property returns 0 when a user selects …
Browse files Browse the repository at this point in the history
…a matrix row value fix #9530
  • Loading branch information
andrewtelnov committed Feb 27, 2025
1 parent c2dec5c commit 7ec8ebe
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/survey-core/src/survey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6183,6 +6183,7 @@ export class SurveyModel extends SurveyElementCore
question.onSurveyValueChanged(newValue);
}
}
this.updateProgressText(true);
this.fireOnValueChanged(valueName, newValue, !!questionName ? this.getQuestionByName(questionName) : undefined);
if (this.isDisposed) return;
this.checkElementsBindings(valueName, newValue);
Expand Down
15 changes: 15 additions & 0 deletions packages/survey-core/tests/surveytests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1123,6 +1123,21 @@ QUnit.test("survey.progressBarType = 'pages', Bug #6563",
assert.equal(survey.progressText, "Page 4 of 4", "page4, #3");
}
);
QUnit.test("survey.progressBarType = 'value', Bug #9532", function (assert) {
const survey = new SurveyModel({
progressBarType: "questions",
elements: [{ type: "text", name: "q1" }, { type: "text", name: "q2" }],
});
let progressValue = 0;
assert.equal(survey.progressValue, 0, "progressValue #1");
survey.onValueChanged.add((sender, options) => {
progressValue = sender.progressValue;
});
survey.getQuestionByName("q1").value = "1";
assert.equal(progressValue, 50, "progressValue #2");
survey.getQuestionByName("q2").value = "2";
assert.equal(progressValue, 100, "progressValue #3");
});
QUnit.test("Next, Prev, Next", function (assert) {
var survey = new SurveyModel();
survey.addPage(createPageWithQuestion("Page 1"));
Expand Down

0 comments on commit 7ec8ebe

Please sign in to comment.