I am using the below given code to remove the dropdown option when selecting a specific value (Delta Emax and Delta IC50) in another select option. The code does remove the dropdown option but still keep giving the label=Select drug on the display page. I want to remove both label and dropdown option when I am selecting else option. And have both label and dropdown when selecting if
drug_options = [{"label": drug, "value": drug} for drug in sorted(set(all_drugs))]
dbc.Label("Select drug:"),
dcc.Dropdown(id="drug_selector", options=drug_options, placeholder="All"),
@app.callback(Output("drug_selector", "style"), Input("x_selector2", "value"))
def update_controls(selected_x):
if selected_x in ["Delta Emax", "Delta IC50"]:
return {}
else:
return {'display': 'none'}