I have a button that runs a long running function. I have it so that it sets the button widget to loading while it runs. This works fine but if I run panel with threads or change the on_click function to async, the spinner doesn’t show. How do I get this to work?
class MyView(pn.Viewable.Viewer):
def __init__(self, **params):
self.submit_button = pn.widgets.Button(name="Submit", button_type="primary")
self.submit_button.on_click(self.on_click)
def on_click(self):
with self.submit_button.param.update(loading=True):
time.sleep(10)