Hi all,
I have a set of chained callbacks that control UI elements, somewhat like the chained callback example at https://plot.ly/dash/getting-started-part-2 .
When the app is running and a user clicks a component, the callbacks always execute in the right order, because they are chained. However when the app first starts up, the callbacks are all automatically called and it seems like the order is random? This means a callback can be called before its input component’s state has been initialised. It also means some callbacks will be called multiple times when the app launches - they will be called automatically, and ALSO called when the callback before them is called automatically and triggers them.
The solution that occurs to me is to make each callback check that its input has been initialised, and do nothing if it hasn’t.
I’m wondering if there is a better way though? Does Dash have a feature to handle this situation? A nice solution would be if I could specify that some callbacks should not be called automatically on start-up. I could set only the first callback in the chain to be called on startup, and let it trigger the others.
I’m still pretty new to Dash so I may be missing something obvious.
Thanks!