Skip to content

Commit

Permalink
onPropertyChanged event is not fired on changing property for multipl…
Browse files Browse the repository at this point in the history
…e text item fix #9200 (#9201)
  • Loading branch information
andrewtelnov authored Dec 24, 2024
1 parent f49df2c commit 3f6a356
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/survey-core/src/question_multipletext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ export class MultipleTextItemModel extends Base
if (title) {
this.title = title;
}
this.editor.onPropertyChanged.add((sender, options) => {
this.onPropertyChanged.fire(this, options);
});
}
public getType(): string {
return "multipletextitem";
Expand Down
12 changes: 12 additions & 0 deletions packages/survey-core/tests/editingObjectTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1789,3 +1789,15 @@ QUnit.test("Column visible property", function (assert) {
assert.equal(column.visible, false, "column visible property, #3");
assert.equal(Serializer.getObjPropertyValue(column, "visible"), false, "Serializer.getObjPropertyValue, #3");
});
QUnit.test("Multiple text item, onPropertyValueChanged", function (assert) {
const question = new QuestionMultipleTextModel("q1");
const item = question.addItem("item1");
const logs = new Array<string>();
item.onPropertyChanged.add((sender, options) => {
logs.push(options.name);
});
item.name = "item2";
item.title = "Item 2";
item.validators.push(new ExpressionValidator("{q1}=1"));
assert.deepEqual(logs, ["name", "title", "validators"], "#1");
});

0 comments on commit 3f6a356

Please sign in to comment.