Hi, I’m using the dash mantine components very frequently lately and I’m loving it.
I’ve noticed that the buttons has a loading param which can very elegantly display a spinner replacing the icon.
How do I activate that loading state throughout the duration of my callback if I do not want to use background callbacks?
Is there any neat tricks I can use?
I’ve checked the dcc.loading documentation as well, but I’m not sure if I can stitch it together with that…
Thanks @AIMPED - that is a clever use of the duplicate outputs!
I’ve tweaked your example a bit and are hitting the loading state of the button instead of changing the icon, the effect is the same just plain dmc instead of injecting the dcc.Loading component in there.
FYI you probably want to make the first callback (the one that just changes the loading attribute) a clientside one to ensure that it runs before the other. When I tried on the DMC website the order got reversed and the button got stuck in loading state after having retrieved the ‘results’.