@@ -35,8 +35,8 @@ type EasingFn = (currentTime: number, startValue: number,
3535 selector : 'md-progress-circle' ,
3636 host : {
3737 'role' : 'progressbar' ,
38- 'aria-valuemin' : '0 ' ,
39- 'aria-valuemax' : '100 ' ,
38+ '[attr. aria-valuemin] ' : 'ariaValueMin ' ,
39+ '[attr. aria-valuemax] ' : 'ariaValueMax ' ,
4040 } ,
4141 templateUrl : 'progress-circle.html' ,
4242 styleUrls : [ 'progress-circle.css' ] ,
@@ -49,6 +49,22 @@ export class MdProgressCircle implements OnDestroy {
4949 /** The id of the indeterminate interval. */
5050 private _interdeterminateInterval : number ;
5151
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+
5268 /** @internal */
5369 get interdeterminateInterval ( ) {
5470 return this . _interdeterminateInterval ;
@@ -79,19 +95,21 @@ export class MdProgressCircle implements OnDestroy {
7995 /**
8096 * Value of the progress circle.
8197 *
82- * Input:number, defaults to 0.
98+ * Input:number
8399 * _value is bound to the host as the attribute aria-valuenow.
84100 */
85- private _value : number = 0 ;
101+ private _value : number ;
86102 @Input ( )
87103 @HostBinding ( 'attr.aria-valuenow' )
88104 get value ( ) {
89- return this . _value ;
105+ if ( this . mode == 'determinate' ) {
106+ return this . _value ;
107+ }
90108 }
91109 set value ( v : number ) {
92- if ( v ) {
110+ if ( v && this . mode == 'determinate' ) {
93111 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 ) ;
95113 this . _value = newValue ;
96114 }
97115 }
@@ -206,6 +224,7 @@ export class MdProgressCircle implements OnDestroy {
206224 selector : 'md-spinner' ,
207225 host : {
208226 'role' : 'progressbar' ,
227+ 'mode' : 'indeterminate' ,
209228 } ,
210229 templateUrl : 'progress-circle.html' ,
211230 styleUrls : [ 'progress-circle.css' ] ,
0 commit comments