Skip to content

Commit

Permalink
fix(bootstrap): updates dirty state before modelChange in multicheckbox
Browse files Browse the repository at this point in the history
fix #3302
  • Loading branch information
aitboudad committed May 27, 2022
1 parent cc10cb9 commit 1ea4463
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/bootstrap/src/lib/types/multicheckbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export class FormlyFieldMultiCheckbox extends FieldType {
};

onChange(value: any, checked: boolean) {
this.formControl.markAsDirty();
if (this.to.type === 'array') {
this.formControl.patchValue(checked
? [...(this.formControl.value || []), value]
Expand Down
1 change: 1 addition & 0 deletions src/material/multicheckbox/src/multicheckbox.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export class FormlyFieldMultiCheckbox extends FieldType {
};

onChange(value: any, checked: boolean) {
this.formControl.markAsDirty();
if (this.to.type === 'array') {
this.formControl.patchValue(checked
? [...(this.formControl.value || []), value]
Expand Down

0 comments on commit 1ea4463

Please sign in to comment.