✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
⚡️ Concerned about the grid? Kyle Baranko teaches how to predicting peak loads using XGBoost. Register for the August webinar!

Reset Dropdown default values

hi Team,

Could you please help - I was trying to empty the selection in dropdown (planning to do this for multiple dropdowns) values at a button click but this does’t seems to be working.
Capture

Reset Filter values

@app.callback(dash.dependencies.Output(‘filterByN1’, ‘value’),
[dash.dependencies.Input(‘resetButton’, ‘n_clicks’)])
def on_click(n_clicks):
if (n_clicks):
return {‘value’:None}

Above snippet is replacing all selected values within a dropdown to Nan value as displayed in above image.

regards,

This isn’t the right Dash syntax. Where did you find this example? (Just so that we’re not misdocumenting this anywhere!). It should just be return None

Don’t have the reference link now but have seen this in some of the examples in forum.

OK. If you can find out where, please let us know. We don’t want things to be misdocumented!