39
39
</ td >
40
40
< td >
41
41
< md-input-container class ="demo-full-width ">
42
- < input mdInput #postalCode maxLength ="5 " placeholder ="Postal Code " value ="94043 ">
42
+ < input mdInput #postalCode maxLength ="5 " placeholder ="Postal Code " value ="94043 "
43
+ pattern ="[0-9]{5} " aria-controls ="zipChars ">
43
44
< md-hint align ="end ">
44
45
< md-icon > mode_edit</ md-icon >
45
- {{postalCode.value.length}} / 5
46
+ < span id =" zipChars " aria-live =" polite " > {{postalCode.value.length}} / 5</ span >
46
47
</ md-hint >
47
48
</ md-input-container >
48
49
</ td >
@@ -152,8 +153,11 @@ <h4>Input</h4>
152
153
#characterCountInputHintExample
153
154
placeholder ="Character count (100 max) "
154
155
maxLength ="100 "
156
+ aria-controls ="helloInputChars "
155
157
value ="Hello world. How are you? ">
156
- < md-hint align ="end "> {{characterCountInputHintExample.value.length}} / 100</ md-hint >
158
+ < md-hint align ="end " id ="helloInputChars " aria-live ="polite ">
159
+ {{characterCountInputHintExample.value.length}} / 100
160
+ </ md-hint >
157
161
</ md-input-container >
158
162
</ p >
159
163
@@ -163,8 +167,11 @@ <h4>Textarea</h4>
163
167
< textarea mdInput
164
168
#characterCountTextareaHintExample
165
169
placeholder ="Character count (100 max) "
170
+ aria-controls ="helloTextareaChars "
166
171
maxLength ="100 "> Hello world. How are you?</ textarea >
167
- < md-hint align ="end "> {{characterCountTextareaHintExample.value.length}} / 100</ md-hint >
172
+ < md-hint align ="end " id ="helloTextareaChars " aria-live ="polite ">
173
+ {{characterCountTextareaHintExample.value.length}} / 100
174
+ </ md-hint >
168
175
</ md-input-container >
169
176
</ p >
170
177
</ md-card-content >
@@ -194,8 +201,11 @@ <h4>Textarea</h4>
194
201
</ p >
195
202
< p >
196
203
< md-input-container style ="width: 100% ">
197
- < input mdInput #input placeholder ="Character count (100 max) " maxLength ="100 ">
198
- < md-hint align ="end "> {{input.value.length}} / 100</ md-hint >
204
+ < input mdInput #input placeholder ="Character count (100 max) " maxLength ="100 "
205
+ aria-controls ="inputChars ">
206
+ < md-hint align ="end " id ="inputChars " aria-live ="polite ">
207
+ {{input.value.length}} / 100
208
+ </ md-hint >
199
209
</ md-input-container >
200
210
</ p >
201
211
< p >
@@ -217,17 +227,24 @@ <h4>Textarea</h4>
217
227
</ p >
218
228
< p >
219
229
< md-input-container hintLabel ="Hint label " style ="width: 100% ">
220
- < input mdInput #hintLabelWithCharCount placeholder ="Show Hint Label With Character Count ">
221
- < md-hint align ="end "> {{hintLabelWithCharCount.value.length}}</ md-hint >
230
+ < input mdInput #hintLabelWithCharCount placeholder ="Show Hint Label With Character Count "
231
+ aria-controls ="inputChars2 ">
232
+ < md-hint align ="end " id ="inputChars2 " aria-live ="polite ">
233
+ {{hintLabelWithCharCount.value.length}}
234
+ </ md-hint >
222
235
</ md-input-container >
223
236
</ p >
224
237
< p >
225
238
< md-input-container style ="margin-bottom: 4em ">
226
- < textarea mdInput #longHint placeholder ="Enter text to count "> </ textarea >
239
+ < textarea mdInput #longHint placeholder ="Enter text to count "
240
+ aria-controls ="counterChars "> </ textarea >
227
241
< md-hint >
228
- Enter some text to count how many characters are in it. The character count is shown on the right.
242
+ Enter some text to count how many characters are in it. The character count is shown on
243
+ the right.
244
+ </ md-hint >
245
+ < md-hint align ="end " style ="white-space: nowrap " id ="counterChars " aria-live ="polite ">
246
+ Length: {{longHint.value.length}}
229
247
</ md-hint >
230
- < md-hint align ="end " style ="white-space: nowrap "> Length: {{longHint.value.length}}</ md-hint >
231
248
</ md-input-container >
232
249
</ p >
233
250
< p >
@@ -249,7 +266,8 @@ <h4>Textarea</h4>
249
266
< md-input-container [hideRequiredMarker] ="hideRequiredMarker " style ="width: 300px ">
250
267
< input mdInput
251
268
required
252
- [placeholder] ="hideRequiredMarker ? 'Required Without Marker' : 'Required With Marker' ">
269
+ [placeholder] ="hideRequiredMarker ?
270
+ 'Required Without Marker' : 'Required With Marker' ">
253
271
</ md-input-container >
254
272
</ p >
255
273
< p >
@@ -327,11 +345,13 @@ <h4>Textarea</h4>
327
345
< md-card class ="demo-card demo-basic ">
328
346
< md-toolbar color ="primary "> Forms</ md-toolbar >
329
347
< md-card-content >
330
- < md-input-container > < input mdInput placeholder ="reactive " [formControl] ="formControl "> </ md-input-container >
348
+ < md-input-container > < input mdInput placeholder ="reactive " [formControl] ="formControl ">
349
+ </ md-input-container >
331
350
< md-input-container >
332
351
< input mdInput placeholder ="template " [(ngModel)] ="model " required [disabled] ="ctrlDisabled ">
333
352
</ md-input-container >
334
- < button md-raised-button color ="primary " (click) ="formControl.enabled ? formControl.disable() : formControl.enable() ">
353
+ < button md-raised-button color ="primary "
354
+ (click) ="formControl.enabled ? formControl.disable() : formControl.enable() ">
335
355
DISABLE REACTIVE CTRL
336
356
</ button >
337
357
< button md-raised-button color ="primary " (click) ="ctrlDisabled = !ctrlDisabled ">
0 commit comments