Bug: Progress Bar query mode not animated
See original GitHub issueBug, feature request, or proposal:
Bug
What is the expected behavior?
Show query animation
What is the current behavior?
Progress bare with the mode query
is not animated anymore since Angular Material 6.1.0
What are the steps to reproduce?
Providing a StackBlitz reproduction is the best way to share your issue.
StackBlitz starter: https://goo.gl/wwnhMV
What is the use-case or motivation for changing an existing behavior?
Add this progress bar for example with the latest angular material version 6.2
<mat-progress-bar mode="query" color="accent"></mat-progress-bar>
or check out the angular material website: https://material.angular.io/components/progress-bar/overview
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
- latest Angular
- Angular CDK 6.1.0
- Angular Material 6.1.0
Issue Analytics
- State:
- Created 5 years ago
- Reactions:10
- Comments:12 (2 by maintainers)
Top Results From Across the Web
Indeterminate progress bar not working properly
It shows on screen as determinate status bar. I have tried with different modes too i.e. query,buffer. But it only works as a...
Read more >Progress Bar in Angular using Material component mat ...
This mat-progress-bar is part of angular material module called ... Determinate mode; Indeterminate mode; Buffer mode; Query mode.
Read more >UIProgressView progressTintColor bug - Apple Developer
The bug is that when I change at runtime the progressTintColor the progress bar becomes rounded corners and the actual progress does not...
Read more >22615 – [Dialogs] Native ProgressBar look does not ... - Bugs
On MacOS X the Windows look of the AnimatedProgress does not match the Aqua look of the native ProgressBar. So clients using the...
Read more >ProgressBar - Android Developers
Use indeterminate mode for the progress bar when you do not know how long an ... android:animationResolution, Timeout between frames of animation in ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
indeterminate
,query
, andbuffer
all don’t animate for me.The
buffer
’s specifiedvalue
andbufferValue
do correctly set up the progress bar, but it is static.In addition, for both
determinate
andbuffer
, when thevalue
is changed, there is no smooth transition between the start value and end value, it just “snaps” immediately to the new value.I’m using Angular CLI 6.0.8 and @angular/material 6.4.0
(this is all true for spinners as well.)
I experienced this issue in
@angular/material@6.4.7
when using theMatProgressBarModule
like soThe
ngIf
was showing and hidding the bar just fine but the animation was FROZEN ☃️. So I started to remove classes on themat-progress-bar
component as found the issue to be with the class_mat-animation-noopable
. If I remove this class everything is totally fine. This class seems to be removing the animation when not loading.Which is clear when looking at the scss of the
mat-progress-bar
component.https://github.com/angular/material2/blob/2290063ec817810d40fead7e237259c1aaf1d7d7/src/lib/progress-bar/progress-bar.scss#L139-L153
This class is bound to the
mat-progress-bar
herehttps://github.com/angular/material2/blob/2290063ec817810d40fead7e237259c1aaf1d7d7/src/lib/progress-bar/progress-bar.ts#L96
_noopAnimation
is set in the constructor based on the_animationMode
https://github.com/angular/material2/blob/2290063ec817810d40fead7e237259c1aaf1d7d7/src/lib/progress-bar/progress-bar.ts#L124
_animationMode
is an@Optional
InjectionToken
of the following typeANIMATION_MODULE_TYPE
Which is set here https://github.com/angular/material2/blob/2290063ec817810d40fead7e237259c1aaf1d7d7/src/lib/progress-bar/progress-bar.ts#L107
The issue is that the default value sets this
InjectionToken
to'NoopAnimations'
which adds the class to the component and FREEZES the animations. By providingANIMATION_MODULE_TYPE
with a'BrowserAnimations'
which will not add the class to the component and unfreezes the animations. You can do this in the component that is using themat-progress-bar
as such.Hope this helps someone 👍