progressbar.js
progressbar.js copied to clipboard
Setting duration to 0 should disable animation
It would be useful if when a progress bar has a duration = 0, then animation would be disabled.
I understand that it may be possible to address this with .set()
vs .animate()
- but unfortunately, my use case doesn't allow for this...
Could you explain a bit more why your use case doesn't allow that? Even though the duration would be set to 0, you still have to call .set() or .animate().
I'm actually using EmberJS, so I use an add-on which wraps progress.js (https://github.com/patience-tema-baron/ember-progress-bar).
This wrapper doesn't expose a way to set or animate. I could request that maintainer adds it as a feature to the wrapper, but it seems it would make for a cleaner API to your upstream project if it were added here...
Seems that .set()
vs .animate()
is an implementation detail anyway and presence (or absence) of duration is a better indication of whether to animate the progress bar...
Ok thanks for the explanation. In this case I think duration 0 could indeed disable the animation as you explained.
In general, ProgressBar.js exposes a simple imperative API by design. Wrappers (e.g. for React or Ember) should be wrap this to a more native API in their worlds.
I'm open for a PR to this feature. It should be quite simple change.