I am trying to set the focus (the cursor to blink) on the input box on the click on the custom radio button. But it is not happening.I have stackblitz demo here.
so far I have tried.
<mat-radio-group [(ngModel)]="selection" #radioGroup="matRadioGroup">
<mat-radio-button value="option 1">option 1</mat-radio-button>
<mat-radio-button value="option 2">option 2</mat-radio-button>
<mat-radio-button value="option 3">option 3</mat-radio-button>
<mat-radio-button value="option 4">option 4</mat-radio-button>
<mat-radio-button [value]="customOption" (click)="onBlur()">
<mat-form-field>
<input matInput id="input" [(ngModel)]="customOption" />
</mat-form-field>
</mat-radio-button>
</mat-radio-group>
in component
onBlur() {
document.getElementById('input').focus();
}