@@ -35,8 +35,8 @@ type EasingFn = (currentTime: number, startValue: number,
35
35
selector : 'md-progress-circle' ,
36
36
host : {
37
37
'role' : 'progressbar' ,
38
- 'aria-valuemin' : '0 ' ,
39
- 'aria-valuemax' : '100 ' ,
38
+ '[attr. aria-valuemin] ' : 'ariaValueMin ' ,
39
+ '[attr. aria-valuemax] ' : 'ariaValueMax ' ,
40
40
} ,
41
41
templateUrl : 'progress-circle.html' ,
42
42
styleUrls : [ 'progress-circle.css' ] ,
@@ -49,6 +49,22 @@ export class MdProgressCircle implements OnDestroy {
49
49
/** The id of the indeterminate interval. */
50
50
private _interdeterminateInterval : number ;
51
51
52
+ /**
53
+ * Values for aria max and min are only defined as numbers when in a determinate mode. We do this
54
+ * because voiceover does not report the progress indicator as indeterminate if the aria min
55
+ * and/or max value are number values.
56
+ *
57
+ * @internal
58
+ */
59
+ get ariaValueMin ( ) {
60
+ return this . mode == 'determinate' ? 0 : null ;
61
+ }
62
+
63
+ /** @internal */
64
+ get ariaValueMax ( ) {
65
+ return this . mode == 'determinate' ? 100 : null ;
66
+ }
67
+
52
68
/** @internal */
53
69
get interdeterminateInterval ( ) {
54
70
return this . _interdeterminateInterval ;
@@ -79,19 +95,21 @@ export class MdProgressCircle implements OnDestroy {
79
95
/**
80
96
* Value of the progress circle.
81
97
*
82
- * Input:number, defaults to 0.
98
+ * Input:number
83
99
* _value is bound to the host as the attribute aria-valuenow.
84
100
*/
85
- private _value : number = 0 ;
101
+ private _value : number ;
86
102
@Input ( )
87
103
@HostBinding ( 'attr.aria-valuenow' )
88
104
get value ( ) {
89
- return this . _value ;
105
+ if ( this . mode == 'determinate' ) {
106
+ return this . _value ;
107
+ }
90
108
}
91
109
set value ( v : number ) {
92
- if ( v ) {
110
+ if ( v && this . mode == 'determinate' ) {
93
111
let newValue = clamp ( v ) ;
94
- this . _animateCircle ( this . value , newValue , linearEase , DURATION_DETERMINATE , 0 ) ;
112
+ this . _animateCircle ( ( this . value || 0 ) , newValue , linearEase , DURATION_DETERMINATE , 0 ) ;
95
113
this . _value = newValue ;
96
114
}
97
115
}
@@ -206,6 +224,7 @@ export class MdProgressCircle implements OnDestroy {
206
224
selector : 'md-spinner' ,
207
225
host : {
208
226
'role' : 'progressbar' ,
227
+ 'mode' : 'indeterminate' ,
209
228
} ,
210
229
templateUrl : 'progress-circle.html' ,
211
230
styleUrls : [ 'progress-circle.css' ] ,
0 commit comments