Learn how to use Dash Bio for next-gen sequencing & quality control. 🧬Register for the Oct 27 webinar.

Replace empty value in dropdown

Hey there,

I have a multi drop-down that I want to display a default value if its blank:

 options=[{'label':i,'value':i} for i in areas],

I tried to implement a callback, but this obviously has the same input and output which isn’t correct.

def refresh_dropdown(x):
        if x == ['']:
            return ['All']
            return country

Any ideas how to handle this, I can set up the function that uses the dropdown as an input to use all but would like the user to see that what is being selected.


I would suggest to set the placeholder as “All” and you would then catch when the value is None or empty list and interpret it as “All”.

Hey Renaud, that’s my current solution, I was just wondering if its possible to enter a value into a multi drop down, so the user

I was thinking perhaps having a hidden dropdown but that mirrors if not blank and inputs when blank but that creates an undesired loop.