Skip to content

Commit

Permalink
fix(multiple): remove workarounds for formControl directive
Browse files Browse the repository at this point in the history
The formControl directive previously did not mark itself for check, so
several components that work closely with this directive marked for
check on its behalf as a workaround. Now that the directive is fixed we
can remove the workarounds.
  • Loading branch information
mmalerba committed Jun 20, 2024
1 parent 46fa535 commit 7a07f03
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 13 deletions.
1 change: 0 additions & 1 deletion src/material/autocomplete/autocomplete-trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,6 @@ export class MatAutocompleteTrigger
// Implemented as part of ControlValueAccessor.
setDisabledState(isDisabled: boolean) {
this._element.nativeElement.disabled = isDisabled;
this._changeDetectorRef.markForCheck();
}

_handleKeydown(event: KeyboardEvent): void {
Expand Down
12 changes: 1 addition & 11 deletions src/material/chips/chip-grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
EventEmitter,
Input,
OnDestroy,
OnInit,
Optional,
Output,
QueryList,
Expand Down Expand Up @@ -91,8 +90,7 @@ export class MatChipGrid
ControlValueAccessor,
DoCheck,
MatFormFieldControl<any>,
OnDestroy,
OnInit
OnDestroy
{
/**
* Implemented as part of MatFormFieldControl.
Expand Down Expand Up @@ -280,14 +278,6 @@ export class MatChipGrid
);
}

ngOnInit() {
if (this.ngControl) {
this.ngControl.control?.events.pipe(takeUntil(this._destroyed)).subscribe(() => {
this._changeDetectorRef.markForCheck();
});
}
}

ngAfterContentInit() {
this.chipBlurChanges.pipe(takeUntil(this._destroyed)).subscribe(() => {
this._blur();
Expand Down
1 change: 0 additions & 1 deletion src/material/radio/radio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ export class MatRadioGroup implements AfterContentInit, OnDestroy, ControlValueA
_touch() {
if (this.onTouched) {
this.onTouched();
this._changeDetector.markForCheck();
}
}

Expand Down

0 comments on commit 7a07f03

Please sign in to comment.