mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-15 09:34:19 +08:00
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:
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1639,14 +1639,14 @@ export declare interface IonRadio extends Components.IonRadio {
|
||||
|
||||
|
||||
@ProxyCmp({
|
||||
inputs: ['allowEmptySelection', 'compareWith', 'name', 'value']
|
||||
inputs: ['allowEmptySelection', 'compareWith', 'errorText', 'helperText', 'name', 'value']
|
||||
})
|
||||
@Component({
|
||||
selector: 'ion-radio-group',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
template: '<ng-content></ng-content>',
|
||||
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
|
||||
inputs: ['allowEmptySelection', 'compareWith', 'name', 'value'],
|
||||
inputs: ['allowEmptySelection', 'compareWith', 'errorText', 'helperText', 'name', 'value'],
|
||||
})
|
||||
export class IonRadioGroup {
|
||||
protected el: HTMLIonRadioGroupElement;
|
||||
|
@ -16,7 +16,7 @@ import { defineCustomElement } from '@ionic/core/components/ion-radio-group.js';
|
||||
|
||||
import { ProxyCmp, proxyOutputs } from './angular-component-lib/utils';
|
||||
|
||||
const RADIO_GROUP_INPUTS = ['allowEmptySelection', 'compareWith', 'name', 'value'];
|
||||
const RADIO_GROUP_INPUTS = ['allowEmptySelection', 'compareWith', 'errorText', 'helperText', 'name', 'value'];
|
||||
|
||||
/**
|
||||
* Pulling the provider into an object and using PURE works
|
||||
|
Reference in New Issue
Block a user