Skip to content

Commit

Permalink
Do not send notification to matrix on creating a new column (#9067)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtelnov authored Nov 18, 2024
1 parent 009dfa8 commit e486e8b
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions packages/survey-core/src/question_matrixdropdowncolumn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,7 @@ export class MatrixDropdownColumn extends Base
this.createLocalizableString("cellHint", this);
this.registerPropertyChangedHandlers(["showInMultipleColumns"], () => { this.doShowInMultipleColumnsChanged(); });
this.registerPropertyChangedHandlers(["visible"], () => { this.doColumnVisibilityChanged(); });
this.updateTemplateQuestion();
this.name = name;
if (title) {
this.title = title;
} else {
this.templateQuestion.locTitle.strChanged();
}
this.updateTemplateQuestion(undefined, name, title);
}
public getOriginalObj(): Base {
return this.templateQuestion;
Expand Down Expand Up @@ -698,7 +692,7 @@ export class MatrixDropdownColumn extends Base
);
}
}
defaultCellTypeChanged() {
defaultCellTypeChanged(): void {
this.updateTemplateQuestion();
}
protected calcCellQuestionType(row: MatrixDropdownRowModelBase): string {
Expand All @@ -714,7 +708,7 @@ export class MatrixDropdownColumn extends Base
if (this.colOwner) return this.colOwner.getCellType();
return settings.matrix.defaultCellType;
}
protected updateTemplateQuestion(newCellType?: string): void {
protected updateTemplateQuestion(newCellType?: string, name?: string, title?: string): void {
const curCellType = this.getDefaultCellQuestionType(newCellType);
const prevCellType = this.templateQuestion
? this.templateQuestion.getType()
Expand All @@ -726,6 +720,14 @@ export class MatrixDropdownColumn extends Base
this.templateQuestionValue = this.createNewQuestion(curCellType);
this.templateQuestion.locOwner = this;
this.addProperties(curCellType);
if(!!name) {
this.name = name;
}
if(!!title) {
this.title = title;
} else {
this.templateQuestion.locTitle.strChanged();
}
this.templateQuestion.onPropertyChanged.add((sender, options) => {
this.propertyValueChanged(
options.name,
Expand Down

0 comments on commit e486e8b

Please sign in to comment.