I have quite a few dropdowns, some with set values from the beginning while others just have placeholder values (i.e. ‘Select X’). I have another button that resets all of the dropdowns but the value within the dropdown remains the same. For example, if I have a dropdown that is selecting fruits and the user selects apples to filter the data, and then they reset the filters (which clears all filters and would change the selected_fruit = None) the ‘apple’ would still remain in the dropdown box instead of the original placeholder.
TL;DR I want to have my callback clear my dropdown or reset it to the placeholder.
I think return
value= in call back would work. Something as below:
from dash import Dash, dcc, html, Input, Output
from plotly.express import data
import pandas as pd
df = data.medals_long()
app = Dash(__name__, external_stylesheets=[dbc.themes.LUX])
app.layout = dbc.Container([
if n_clicks > 1:
if __name__ == '__main__':
Maybe an MRE would help in this case.