Open sdc50 opened 3 years ago
Fixed in #2467 but there is a wrinkle with your code, for some reason this doesn't work:
btn.css_classes.push("pn-loading", "arcs");
btn.properties.css_classes.change.emit()
but this does:
btn.css_classes = ["pn-loading", "arcs"]
I often want to set the loading state of some element with JavaScript:
but then I want to reset it in Python. I assumed this this would be sufficient:
But setting
css_classes
to the empty list doesn't trigger a change, presumably because the change tocss_classes
wasn't propagated from the JS so Python sees it as still sees it as the empty list.So I assumed that this would force the JS Bokeh model to reset:
But it is also ineffective at resetting the loading state.
The only thing that I could get to work is to set
css_classes
to something else:Here is a full example: