feat(radio-group): add helperText and errorText properties (#30222)

Issue number: N/A

---------

## What is the current behavior?
Radio group does not support helper and error text.

## What is the new behavior?
Adds support for helper and error text.

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

## Other information

- [Supporting Text:
Preview](https://ionic-framework-git-rou-11554-ionic1.vercel.app/src/components/radio-group/test/supporting-text)

---------

Co-authored-by: Brandy Smith <6577830+brandyscarney@users.noreply.github.com>
This commit is contained in:
Brandy Smith
2025-03-10 19:07:22 -04:00
committed by GitHub
parent bbdaec0cc1
commit 18e26acb01
34 changed files with 625 additions and 4 deletions

View File

@ -52,6 +52,13 @@ export class ValueAccessor implements ControlValueAccessor, AfterViewInit, OnDes
if (el === this.elementRef.nativeElement) {
this.onTouched();
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();
}
}