Skip to content

Commit 58d7315

Browse files
authored
refactor(radio): remove legacy property and support for legacy syntax (#29038)
BREAKING CHANGE: The `legacy` property and support for the legacy syntax, which involved placing an `ion-radio` inside of an `ion-item` with an `ion-label`, have been removed from radio. For more information on migrating from the legacy radio syntax, refer to the [Radio documentation](https://ionicframework.com/docs/api/radio#migrating-from-legacy-radio-syntax).
1 parent c72eced commit 58d7315

File tree

102 files changed

+20
-1442
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+20
-1442
lines changed

BREAKING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ This is a comprehensive list of the breaking changes introduced in the major ver
2424
- [Nav](#version-8x-nav)
2525
- [Picker](#version-8x-picker)
2626
- [Progress bar](#version-8x-progress-bar)
27+
- [Radio](#version-8x-radio)
2728
- [Select](#version-8x-select)
2829
- [Textarea](#version-8x-textarea)
2930
- [Toggle](#version-8x-toggle)
@@ -178,6 +179,10 @@ For more information on the dynamic font, refer to the [Dynamic Font Scaling doc
178179

179180
For more information on styling toast buttons, refer to the [Toast Theming documentation](https://ionicframework.com/docs/api/toast#theming).
180181

182+
<h4 id="version-8x-radio">Radio</h4>
183+
184+
- The `legacy` property and support for the legacy syntax, which involved placing an `ion-radio` inside of an `ion-item` with an `ion-label`, have been removed. For more information on migrating from the legacy radio syntax, refer to the [Radio documentation](https://ionicframework.com/docs/api/radio#migrating-from-legacy-radio-syntax).
185+
181186
<h4 id="version-8x-select">Select</h4>
182187

183188
- The `legacy` property and support for the legacy syntax, which involved placing an `ion-select` inside of an `ion-item` with an `ion-label`, have been removed. For more information on migrating from the legacy select syntax, refer to the [Select documentation](https://ionicframework.com/docs/api/select#migrating-from-legacy-select-syntax).

core/api.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,6 @@ ion-radio,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "secon
10371037
ion-radio,prop,disabled,boolean,false,false,false
10381038
ion-radio,prop,justify,"end" | "space-between" | "start",'space-between',false,false
10391039
ion-radio,prop,labelPlacement,"end" | "fixed" | "stacked" | "start",'start',false,false
1040-
ion-radio,prop,legacy,boolean | undefined,undefined,false,false
10411040
ion-radio,prop,mode,"ios" | "md",undefined,false,false
10421041
ion-radio,prop,name,string,this.inputId,false,false
10431042
ion-radio,prop,value,any,undefined,false,false

core/src/components.d.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2253,10 +2253,6 @@ export namespace Components {
22532253
* Where to place the label relative to the radio. `"start"`: The label will appear to the left of the radio in LTR and to the right in RTL. `"end"`: The label will appear to the right of the radio in LTR and to the left in RTL. `"fixed"`: The label has the same behavior as `"start"` except it also has a fixed width. Long text will be truncated with ellipses ("..."). `"stacked"`: The label will appear above the radio regardless of the direction. The alignment of the label can be controlled with the `alignment` property.
22542254
*/
22552255
"labelPlacement": 'start' | 'end' | 'fixed' | 'stacked';
2256-
/**
2257-
* Set the `legacy` property to `true` to forcibly use the legacy form control markup. Ionic will only opt components in to the modern form markup when they are using either the `aria-label` attribute or the default slot that contains the label text. As a result, the `legacy` property should only be used as an escape hatch when you want to avoid this automatic opt-in behavior. Note that this property will be removed in an upcoming major release of Ionic, and all form components will be opted-in to using the modern form markup.
2258-
*/
2259-
"legacy"?: boolean;
22602256
/**
22612257
* The mode determines which platform styles to use.
22622258
*/
@@ -4145,7 +4141,6 @@ declare global {
41454141
new (): HTMLIonProgressBarElement;
41464142
};
41474143
interface HTMLIonRadioElementEventMap {
4148-
"ionStyle": StyleEventDetail;
41494144
"ionFocus": void;
41504145
"ionBlur": void;
41514146
}
@@ -6930,10 +6925,6 @@ declare namespace LocalJSX {
69306925
* Where to place the label relative to the radio. `"start"`: The label will appear to the left of the radio in LTR and to the right in RTL. `"end"`: The label will appear to the right of the radio in LTR and to the left in RTL. `"fixed"`: The label has the same behavior as `"start"` except it also has a fixed width. Long text will be truncated with ellipses ("..."). `"stacked"`: The label will appear above the radio regardless of the direction. The alignment of the label can be controlled with the `alignment` property.
69316926
*/
69326927
"labelPlacement"?: 'start' | 'end' | 'fixed' | 'stacked';
6933-
/**
6934-
* Set the `legacy` property to `true` to forcibly use the legacy form control markup. Ionic will only opt components in to the modern form markup when they are using either the `aria-label` attribute or the default slot that contains the label text. As a result, the `legacy` property should only be used as an escape hatch when you want to avoid this automatic opt-in behavior. Note that this property will be removed in an upcoming major release of Ionic, and all form components will be opted-in to using the modern form markup.
6935-
*/
6936-
"legacy"?: boolean;
69376928
/**
69386929
* The mode determines which platform styles to use.
69396930
*/
@@ -6950,10 +6941,6 @@ declare namespace LocalJSX {
69506941
* Emitted when the radio button has focus.
69516942
*/
69526943
"onIonFocus"?: (event: IonRadioCustomEvent<void>) => void;
6953-
/**
6954-
* Emitted when the styles change.
6955-
*/
6956-
"onIonStyle"?: (event: IonRadioCustomEvent<StyleEventDetail>) => void;
69576944
/**
69586945
* the value of the radio.
69596946
*/

core/src/components/item/test/disabled/index.html

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,6 @@
4343
<ion-checkbox disabled checked> Disabled Checkbox </ion-checkbox>
4444
</ion-item>
4545

46-
<ion-radio-group value="radio">
47-
<ion-item>
48-
<ion-radio disabled value="radio"> Disabled Radio </ion-radio>
49-
</ion-item>
50-
</ion-radio-group>
51-
5246
<ion-item>
5347
<ion-range disabled value="10">
5448
<span slot="label">Disabled Range</span>
@@ -61,18 +55,6 @@
6155
<ion-label>Multiple Input Disabled Items</ion-label>
6256
</ion-list-header>
6357

64-
<ion-item>
65-
<ion-checkbox aria-label="Checkbox" disabled slot="start"></ion-checkbox>
66-
<ion-label>Checkbox + Radio</ion-label>
67-
<ion-radio aria-label="Radio" slot="end"></ion-radio>
68-
</ion-item>
69-
70-
<ion-item>
71-
<ion-checkbox aria-label="Checkbox" disabled slot="start"></ion-checkbox>
72-
<ion-radio aria-label="Radio" slot="start"></ion-radio>
73-
<ion-label>Checkbox + Radio</ion-label>
74-
</ion-item>
75-
7658
<ion-item>
7759
<ion-checkbox slot="start" aria-label="Checkbox"></ion-checkbox>
7860
<ion-label>Checkbox + Range</ion-label>
-8.41 KB
Loading
-7.89 KB
Loading
-7.62 KB
Loading
-9.96 KB
Loading
-9.04 KB
Loading
-8.48 KB
Loading

0 commit comments

Comments
 (0)