Skip to content

Commit

Permalink
fix(material): handle checkbox destroy (#2618)
Browse files Browse the repository at this point in the history
fix #2602
  • Loading branch information
aitboudad committed Dec 10, 2020
1 parent 65d1bc1 commit ddb26a7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/material/checkbox/src/checkbox.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ export class FormlyFieldCheckbox extends FieldType implements AfterViewInit, Aft
}

ngOnDestroy() {
this.focusMonitor.stopMonitoring(this.checkbox._inputElement);
if (this.checkbox) {
this.focusMonitor.stopMonitoring(this.checkbox._inputElement);
}
}
}

0 comments on commit ddb26a7

Please sign in to comment.