Skip to content

Commit faad298

Browse files
authored
docs(input, textarea): update migration guide for proper metadata usage (#2827)
1 parent c79ba39 commit faad298

File tree

2 files changed

+120
-72
lines changed

2 files changed

+120
-72
lines changed

static/usage/v7/input/migration/index.md

+60-36
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,21 @@ import TabItem from '@theme/TabItem';
5353
</ion-item>
5454
5555
<!-- After -->
56-
<ion-item>
57-
<ion-input
58-
label="Email:"
59-
counter="true"
60-
maxlength="100"
61-
helper-text="Enter an email"
62-
error-text="Please enter a valid email"
63-
></ion-input>
64-
</ion-item>
56+
57+
<!--
58+
Metadata such as counters and helper text should not
59+
be used when an input is in an item/list. If you need to
60+
provide more context on a input, consider using an ion-note
61+
underneath the ion-list.
62+
-->
63+
64+
<ion-input
65+
label="Email:"
66+
counter="true"
67+
maxlength="100"
68+
helper-text="Enter an email"
69+
error-text="Please enter a valid email"
70+
></ion-input>
6571
```
6672
</TabItem>
6773
<TabItem value="angular">
@@ -105,15 +111,21 @@ import TabItem from '@theme/TabItem';
105111
</ion-item>
106112
107113
<!-- After -->
108-
<ion-item>
109-
<ion-input
110-
label="Email:"
111-
[counter]="true"
112-
maxlength="100"
113-
helperText="Enter an email"
114-
errorText="Please enter a valid email"
115-
></ion-input>
116-
</ion-item>
114+
115+
<!--
116+
Metadata such as counters and helper text should not
117+
be used when an input is in an item/list. If you need to
118+
provide more context on a input, consider using an ion-note
119+
underneath the ion-list.
120+
-->
121+
122+
<ion-input
123+
label="Email:"
124+
[counter]="true"
125+
maxlength="100"
126+
helperText="Enter an email"
127+
errorText="Please enter a valid email"
128+
></ion-input>
117129
```
118130
</TabItem>
119131
<TabItem value="react">
@@ -157,15 +169,21 @@ import TabItem from '@theme/TabItem';
157169
</IonItem>
158170
159171
{/* After */}
160-
<IonItem>
161-
<IonInput
162-
label="Email:"
163-
counter={true}
164-
maxlength="100"
165-
helperText="Enter an email"
166-
errorText="Please enter a valid email"
167-
></IonInput>
168-
</IonItem>
172+
173+
{/*
174+
Metadata such as counters and helper text should not
175+
be used when an input is in an item/list. If you need to
176+
provide more context on a input, consider using an IonNote
177+
underneath the IonList.
178+
*/}
179+
180+
<IonInput
181+
label="Email:"
182+
counter={true}
183+
maxlength="100"
184+
helperText="Enter an email"
185+
errorText="Please enter a valid email"
186+
></IonInput>
169187
```
170188
</TabItem>
171189
<TabItem value="vue">
@@ -209,15 +227,21 @@ import TabItem from '@theme/TabItem';
209227
</ion-item>
210228
211229
<!-- After -->
212-
<ion-item>
213-
<ion-input
214-
label="Email:"
215-
:counter="true"
216-
maxlength="100"
217-
helper-text="Enter an email"
218-
error-text="Please enter a valid email"
219-
></ion-input>
220-
</ion-item>
230+
231+
<!--
232+
Metadata such as counters and helper text should not
233+
be used when an input is in an item/list. If you need to
234+
provide more context on a input, consider using an ion-note
235+
underneath the ion-list.
236+
-->
237+
238+
<ion-input
239+
label="Email:"
240+
:counter="true"
241+
maxlength="100"
242+
helper-text="Enter an email"
243+
error-text="Please enter a valid email"
244+
></ion-input>
221245
```
222246
</TabItem>
223247
</Tabs>

static/usage/v7/textarea/migration/index.md

+60-36
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,21 @@ import TabItem from '@theme/TabItem';
5353
</ion-item>
5454
5555
<!-- After -->
56-
<ion-item>
57-
<ion-textarea
58-
label="Label:"
59-
counter="true"
60-
maxlength="100"
61-
helper-text="Enter text"
62-
error-text="Please enter text"
63-
></ion-textarea>
64-
</ion-item>
56+
57+
<!--
58+
Metadata such as counters and helper text should not
59+
be used when a textarea is in an item/list. If you need to
60+
provide more context on a textarea, consider using an ion-note
61+
underneath the ion-list.
62+
-->
63+
64+
<ion-textarea
65+
label="Label:"
66+
counter="true"
67+
maxlength="100"
68+
helper-text="Enter text"
69+
error-text="Please enter text"
70+
></ion-textarea>
6571
```
6672
</TabItem>
6773
<TabItem value="angular">
@@ -105,15 +111,21 @@ import TabItem from '@theme/TabItem';
105111
</ion-item>
106112
107113
<!-- After -->
108-
<ion-item>
109-
<ion-textarea
110-
label="Label:"
111-
[counter]="true"
112-
maxlength="100"
113-
helperText="Enter text"
114-
errorText="Please enter text"
115-
></ion-textarea>
116-
</ion-item>
114+
115+
<!--
116+
Metadata such as counters and helper text should not
117+
be used when a textarea is in an item/list. If you need to
118+
provide more context on a textarea, consider using an ion-note
119+
underneath the ion-list.
120+
-->
121+
122+
<ion-textarea
123+
label="Label:"
124+
[counter]="true"
125+
maxlength="100"
126+
helperText="Enter text"
127+
errorText="Please enter text"
128+
></ion-textarea>
117129
```
118130
</TabItem>
119131
<TabItem value="react">
@@ -157,15 +169,21 @@ import TabItem from '@theme/TabItem';
157169
</IonItem>
158170
159171
{/* After */}
160-
<IonItem>
161-
<IonTextarea
162-
label="Label:"
163-
counter={true}
164-
maxlength="100"
165-
helperText="Enter text"
166-
errorText="Please enter text"
167-
></IonTextarea>
168-
</IonItem>
172+
173+
{/*
174+
Metadata such as counters and helper text should not
175+
be used when a textarea is in an item/list. If you need to
176+
provide more context on a textarea, consider using an IonNote
177+
underneath the IonList.
178+
*/}
179+
180+
<IonTextarea
181+
label="Label:"
182+
counter={true}
183+
maxlength="100"
184+
helperText="Enter text"
185+
errorText="Please enter text"
186+
></IonTextarea>
169187
```
170188
</TabItem>
171189
<TabItem value="vue">
@@ -209,15 +227,21 @@ import TabItem from '@theme/TabItem';
209227
</ion-item>
210228
211229
<!-- After -->
212-
<ion-item>
213-
<ion-textarea
214-
label="Label:"
215-
:counter="true"
216-
maxlength="100"
217-
helper-text="Enter text"
218-
error-text="Please enter text"
219-
></ion-textarea>
220-
</ion-item>
230+
231+
<!--
232+
Metadata such as counters and helper text should not
233+
be used when a textarea is in an item/list. If you need to
234+
provide more context on a textarea, consider using an ion-note
235+
underneath the ion-list.
236+
-->
237+
238+
<ion-textarea
239+
label="Label:"
240+
:counter="true"
241+
maxlength="100"
242+
helper-text="Enter text"
243+
error-text="Please enter text"
244+
></ion-textarea>
221245
```
222246
</TabItem>
223247
</Tabs>

0 commit comments

Comments
 (0)