fix(angular): mark radio group as touched when radio is blurred

This commit is contained in:
Brandy Smith
2025-02-28 16:01:00 -05:00
parent ef31de3fa8
commit b9d8cb9925

View File

@ -52,6 +52,13 @@ export class ValueAccessor implements ControlValueAccessor, AfterViewInit, OnDes
if (el === this.elementRef.nativeElement) { if (el === this.elementRef.nativeElement) {
this.onTouched(); this.onTouched();
setIonicClasses(this.elementRef); setIonicClasses(this.elementRef);
// When ion-radio is blurred, el and this.elementRef.nativeElement are
// different so we need to check if the closest ion-radio-group is the same
// as this.elementRef.nativeElement and if so, we need to mark the radio group
// as touched
} else if (el.closest('ion-radio-group') === this.elementRef.nativeElement) {
this.onTouched();
} }
} }