Dropdown menu sleep/delay to callback?


I have a couple of dropdown (multi) menus in my Dash app, which are used in a callback to filter a pandas dataframe.

Say I remove 4 options from the dropdown, instantly when the first option is removed it fires the callback, causing the expensive filtering to run and wait for that to finish, then fires the removal of second option, runs filtering out the second option and so on…

Is it possible to set a sleep method or delay for the dropdown which causes the callback to not fire instantly?

1 Like

That’s a good idea. Ultimately, I’d like to have a throttle property that’s available in every callback. But, that doesn’t exist right now and I don’t think that there is any workaround aside from using a separate “Update” or “Compute” button next to the dropdown (https://dash.plot.ly/state)

1 Like