Feature request
When resetting the value of an md-progress-bar to 0 (starting a new task), the bar jumps directly to zero and increases from there.
The bar slides backwards towards zero and starts increasing from wherever the animation reached.
http://plnkr.co/edit/XsN52k?p=preview
It seems reasonable to reuse a progress bar, say, to indicate background loads of map tiles. The current behavior creates the visual impression that the progress bar is re-estimating the time for an already-ongoing task, rather than tracking a new one.
Possibly, a reasonable behavior would be to never use animation when setting the value to 0. This is a bit of a "magic corner case" but I think it would be what people intuitively expects.
Angular Material 2.0.0 beta 2
Took a look at your code, there were some things that looked out of place.
this.percentage was not being reset to 0 when you clicked the button and when the 'download' finished.
and you were not removing this.timerHandle if you re-clicked the button.
I tried to keep the code to an absolute minimum to show the "animated slide back" behavior as the salient point. (My actual use case has the progress controlled by load events from multiple tiles in OpenLayers).
Zeroing the percentage as the task completes just makes the bar slide backwards while it fades out at the end, which looks equally screwy.
If you are strictly talking about hitting the button again yeah.. its how the code manages any delta, forward or backward it does bounce back. Google drive spawns a new bar for each download instead of using the same one. I see your point, the code I believe works as intended. but yeah maybe there should be something like a hardReset feature to allow just completely restarting without the animations, a clean slate sort of thing.
So its always changing by a transform, with no way to not have the transform even if resetting.
a reset method would be nice
https://github.com/angular/material2/blob/master/src/lib/progress-bar/progress-bar.ts#L61
Does this currently have a workaround or something?
Closing this since I don't think realistically this would ever make it high enough on the priority queue to address.
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
Does this currently have a workaround or something?