Recommendation: Add Optional Delay to Loading Component

One issue I’ve noticed with loading components is that when used to try and wrap a component with multiple chained callbacks, the Loading animation tends to flicker on/off several times, as each callback completes before kicking off the next one. This creates a poor visual experience, and doesn’t solve the problem the Loading component was originally designed to solve, which is give a nice, graceful way to update components while letting the user know something is still updating.

My recommendation is to add an optional kwarg to Loading to specify a delay (in milliseconds) after a callback completes but before stopping the loading animation. Even a 20 ms delay would not be noticeable, but it would be enough for the next callback to kick off and (hopefully) prevent some of the flicker issues.

1 Like