moff / angular2-ladda

Angular 2 Ladda module
MIT License
97 stars 20 forks source link

Min loader time #24

Closed matheushf closed 6 years ago

matheushf commented 7 years ago

Hello, I was looking at the options and I didn't see an 'min time' or something like that. Sometimes the action happens so fast that the ladda doesn't even show up, so setting a min time would be a good idea.

Let me know if it exists.

theodorejb commented 6 years ago

Adding a "min time" option to Ladda wouldn't fix situations where you not only stop Ladda, but also redirect to a different page when an event completes. So the "min time" option really needs to be part of whatever service you are using to make a request and afterwards stop Ladda.

matheushf commented 6 years ago

The problem is not stopping ladda, but forcing it to always be visible for a minimum time, something like 300ms or whatever the developer chooses.

theodorejb commented 6 years ago

The spinner can't force itself to be visible for a minimum time, though, since you can always hide the button or redirect to a different page. A more robust solution is to wait a minimum time yourself before stopping the spinner or redirecting.