Have Component:loading-btn which display a loading animation in it, +transition with existing btn stuff.
_Think it's a good idea ? add :+1:
Thanks ;)_
I would like to see this kind of button :

See https://github.com/Dogfalo/materialize/pull/4942 for more
is-loading to it, it displays a loading animationis-loading class and YaY it's donebtn for the momentTestable in this fork
I would say initially that this seems a bit unnecessary but if we see people continuously ask for this, we'll consider it.
Will reopen this for now for visibility
@Dogfalo ok :)
I actually need this in my project.
Too much async stuff, and nothing in materialize can handle those scenarios without too much dev.
So I'll work on it anyway ;)
https://jsfiddle.net/tbsgvn6z/
<button class="red btn waves-effect">
<div class="preloader-wrapper small active">
<div class="spinner-layer spinner-blue-only">
<div class="circle-clipper left">
<div class="circle"></div>
</div>
<div class="gap-patch">
<div class="circle"></div>
</div>
<div class="circle-clipper right">
<div class="circle"></div>
</div>
</div>
</div>
</button>
I know its not perfect, but with some css additions this can probably be fixed without re-creating existing components. spinner-white-only would be handy though
@bert-w that's precisely what i want to avoid : DOM manipulation just for a loading animation feels really heavy.
BTW, I already told this in current behavior ^^'
I think this could be a pretty nice addition to make something that fits within Materialize well, but am currently using Ladda: https://github.com/hakimel/Ladda.
You can use the non-styled buttons and apply Materialize classes to make them look like Materialize buttons, but with the loading indicators.
@bassie1995 Oh ^^
I'm just wondering why not implement Ladda in our framework ?
All those loading button are great and use-able easily.
Contract-overlay button is neat for submitting form without manually disabling every input & select.
Or i'll just implement overlay capabilities on my fork ...
EDIT : I did the overlay stuff, way more simple with observer =)
EDIT2 : I tried Ladda, I think there is too much stuff. A simple loading feedback as I did is less complicate to understand & apply them to any project is easier than Ladda. Loading is already implement in Materialize and make them appear on button doesn't seems to be a good idea to me.
People will still be able to add Ladda to their project for specific needs tho.
Materialize definitely needs a loading button, I always wondered why there isn't one.
See my comment over at #4942
Thanks a heap for your advice @Dogfalo keep up the great work !
I would say initially that this seems a bit unnecessary but if we see people continuously ask for this, we'll consider it.
I've never been on a project the last 10 years which didn't have a spinner-on-a-button. It is done on every action which might take some time ie a call to the server. Must have IMO
Most helpful comment
I would say initially that this seems a bit unnecessary but if we see people continuously ask for this, we'll consider it.
Will reopen this for now for visibility