react-spinners icon indicating copy to clipboard operation
react-spinners copied to clipboard

feat: optional animation delay in PuffLoader

Open felamaslen opened this issue 4 years ago • 3 comments

This is a simple feature to delay the animation on PuffLoader. I suppose it could be extended to other loaders too.

The idea is that if you have multiple things loading, and you're rendering the loader from multiple places, you want to keep track of which stage of the animation the loader is in - otherwise, the animation will reset back to the beginning resulting in a jerky animation.

There is an article detailing the application of this here: https://www.selbekk.io/blog/2019/08/how-to-stop-your-spinner-from-jumping-in-react/

felamaslen avatar Jan 02 '21 21:01 felamaslen

thanks for the PR. this looks like a good feature to include. I'm working on releasing v0.11 with animation speed updates. so might bundle this with that release.

One thing I want to take a look at first before merging this is how this affects other loaders. I want to make sure we have a fairly consistent API, and avoid having one offs for individual loaders. especially when it comes to the props typing.

This PR adds the delay prop to every single loader, so people might assume the delay can work on every loader.

davidhu2000 avatar Jan 09 '21 20:01 davidhu2000

thanks for the PR. this looks like a good feature to include. I'm working on releasing v0.11 with animation speed updates. so might bundle this with that release.

One thing I want to take a look at first before merging this is how this affects other loaders. I want to make sure we have a fairly consistent API, and avoid having one offs for individual loaders. especially when it comes to the props typing.

This PR adds the delay prop to every single loader, so people might assume the delay can work on every loader.

Agreed that it should be implemented on every loader.

Perhaps it would be good to implement a spec which any loader must conform to.

felamaslen avatar Jan 09 '21 23:01 felamaslen

Yeah definitely. I think the feature for 0.11 is going to be animation control. I think this could be a good feature for 0.12

davidhu2000 avatar Feb 13 '21 03:02 davidhu2000