Skip to content

Commit bd614b4

Browse files
atscottmmalerba
authored andcommitted
fix(material/radio): updating required value should mark for check (#31109)
This change ensures that updates to the required value of the radio button also mark the component for check, ensuring OnPush compatibility. (cherry picked from commit fc36e66)
1 parent ca231dc commit bd614b4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/material/radio/radio.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,9 @@ export class MatRadioButton implements OnInit, AfterViewInit, DoCheck, OnDestroy
518518
return this._required || (this.radioGroup && this.radioGroup.required);
519519
}
520520
set required(value: boolean) {
521+
if (value !== this._required) {
522+
this._changeDetector.markForCheck();
523+
}
521524
this._required = value;
522525
}
523526

0 commit comments

Comments
 (0)