dcc.Dropdown - bug suspected, please confirm or correct me

I decided to refactor my old Dash dashboard and add some new features ( it works fine as is and is in almost in daily use, with no issues, thanks a lot!).
I started from creating new venv (I use conda) with latest versions provided by conda-forge and fired up code in new env. Everything seemed to work fine… but it does not.

I have a dcc,Dropdowns located in multiple rows on top of each other and I noticed some of the rows stopped displaying my selections. Still, in old env everything do work fine.

After some digging I fund this issue.
I will use sample from docs:

                dcc.Dropdown(id='my name', className='inputbox-long',
                                    {'label': 'New York City', 'value': "50 , 10"},
                                    {'label': 'Montreal', 'value': 'MTL'},
                                    {'label': 'San Francisco', 'value': 'SF'}
                            placeholder="Select one or more",
                            multi=True ),

Problem is in this spot: 'value': "50 , 10"
Specifically comma in value string makes that selection is not being displayed. When coma is removed or replaced (dot creates no issue) it works fine, but when coma is within the string selections are not displayed.

I can work around this but if issue went unnoticed it may be good idea to look at it.
I use dash 2.1.0 pyhd8ed1ab_0 conda-forge.


Hi @Marcas

Well, that’s weird. I think you get the prize for finding the first bug in 2.1 :lady_beetle:

I can verify that in v2.0 that the label “New York City” will display when selected, but not in V2.1. Might be good to open this as an issue on Github.

Thanks for confirmation.
I’m not familiar with formal procedure to report a bug and I welcome if somebody volunteer to do that for us all. :slight_smile: If no volunteers I try to figure it out.

Hey @Marcas

I could create the issue on Github if you prefer, however your post is already a high quality bug report:

Provided details on the Dash version you are using
Described the issue clearly and concisely
Provided a minimal reproducible example.
Checked on the forum for alternate solutions and/or verification of a bug. (you can link to this post in the issue)

Not only that, you went the extra mile to narrow it down to that darn comma. That’s great detective work! :man_detective:

The only thing I would add is that this is new in 2.1 and it works as expected in 2.0. Plus it only affect the multi-value dropdowns.

Just let me know what you decide. I’m happy to help you open your first issue on Github.

1 Like

@AnnMarieW, thank you for kind words. I was simply trying to solve an issue with my code. Comma was the thing for me but I did not investigate for other symbols interfering with desired functionality.

If you are so kind, please, do create Github reporting. I looked at it but I don’t even have account there. Feel free to use any part of org post if it makes task easier. No crediting is necessary, ofc.

BTW. ‘comma issue’ is easy to code around when you know what it is. It’s already done on my end and will work with previous Dash versions. It would be better if correction is done in Dash code, so it’s worth to point it out to developers.


Hi @Marcas

Thanks for reporting! You can track the progress here: [BUG] Dropdown: Selected options not showing when the `value` contains a comma · Issue #1908 · plotly/dash · GitHub

1 Like