Skip to content

Commit

Permalink
editingObj with dataList prop updates question with incorrect value, s…
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtelnov authored Sep 28, 2021
1 parent f7e45a2 commit 8fde3fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/survey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2333,7 +2333,7 @@ export class SurveyModel extends SurveyElementCore
this.onEditingObjPropertyChanged = (sender: Base, options: any) => {
if (!Serializer.hasOriginalProperty(this.editingObj, options.name))
return;
this.updateOnSetValue(options.name, options.newValue, options.oldValue);
this.updateOnSetValue(options.name, (<any>this.editingObj)[options.name], options.oldValue);
};
this.editingObj.onPropertyChanged.add(this.onEditingObjPropertyChanged);
}
Expand Down
2 changes: 2 additions & 0 deletions tests/editingObjectTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,8 @@ QUnit.test("Edit question string[] property type", function(assert) {
dataListQuestion.value = "item1\nitem2\nitem3";
assert.equal(question.dataList.length, 3, "There are three items now");
assert.equal(question.dataList[2], "item3", "The third item is 'item3'");
question.locDataList.setLocaleText(null, "abc\ndef");
assert.equal(dataListQuestion.value, "abc\ndef", "Update edited question correctly");
});
QUnit.test("Edit custom array that returns values onGetValue", function(
assert
Expand Down

0 comments on commit 8fde3fc

Please sign in to comment.