Skip to content

fix(progress-spinner): fallback animation not working #7599

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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