Skip to content

Commit

Permalink
fix(progress-spinner): fallback animation not working (#7599)
Browse files Browse the repository at this point in the history
Fixes #7599.
  • Loading branch information
crisbeto authored and kara committed Oct 6, 2017
1 parent 746799f commit 4bb696e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/lib/progress-spinner/progress-spinner.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,5 @@
[style.animation-name]="'mat-progress-spinner-stroke-rotate-' + diameter"
[style.stroke-dashoffset.px]="_strokeDashOffset"
[style.stroke-dasharray.px]="_strokeCircumference"
[style.transform.rotate]="'360deg'"
[style.stroke-width.px]="strokeWidth"></circle>
</svg>
6 changes: 3 additions & 3 deletions src/lib/progress-spinner/progress-spinner.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ $_mat-progress-spinner-default-circumference: $pi * $_mat-progress-spinner-defau

svg {
position: absolute;
transform: translate(-50%, -50%) rotate(-90deg);
top: 50%;
left: 50%;
transform: rotate(-90deg);
top: 0;
left: 0;
transform-origin: center;
overflow: visible;
}
Expand Down
5 changes: 5 additions & 0 deletions src/lib/progress-spinner/progress-spinner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ export class MatProgressSpinner extends _MatProgressSpinnerMixinBase implements
return this._strokeCircumference * (100 - this._value) / 100;
}

// In fallback mode set the circle to 80% and rotate it with CSS.
if (this._fallbackAnimation && this.mode === 'indeterminate') {
return this._strokeCircumference * 0.2;
}

return null;
}

Expand Down

0 comments on commit 4bb696e

Please sign in to comment.