Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Dropdown: Selected options not showing when the value contains a comma #1908

Closed
AnnMarieW opened this issue Feb 1, 2022 · 1 comment · Fixed by #1970
Closed

[BUG] Dropdown: Selected options not showing when the value contains a comma #1908

AnnMarieW opened this issue Feb 1, 2022 · 1 comment · Fixed by #1970

Comments

@AnnMarieW
Copy link
Collaborator

AnnMarieW commented Feb 1, 2022

As reported on the forum by @ marcus:

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, the selections are not displayed in the input box and are not removed from the options

This only occurs in Multi-Value dropdowns. This is new in Dash V2.1.0 It works as expected in V2.0.0

from dash import Dash, dcc, html, Input, Output

app = Dash(__name__)

app.layout = html.Div(
    [
        dcc.Dropdown(
            id="dropdown",
            className="inputbox-long",
            options=[
                {"label": "New York City", "value": "50, 10"},
                {"label": "Montreal", "value": "MTL" },
                {"label": "San Francisco", "value": "SF"},
            ],
            placeholder="Select one or more",
            multi=True,
        ),
        html.Div(id="output"),
    ]
)


@app.callback(
    Output("output", "children"), Input("dropdown", "value"),
)
def update(value):    
    return value


if __name__ == "__main__":
    app.run_server(debug=True)

dropdown_bug

@astrowonk
Copy link

astrowonk commented Mar 1, 2022

Yikes, yeah this bug is breaking my covid dashboard when I upgraded to 2.2 (so still there not just 2.1) from 2.0. I have a Dropdown with County,State pairs: .e.g. Harris, Texas. It's all broken now.

This is a pretty bad breaking bug, can we get someone assigned to this or otherwise are there any updates? I have reverted to 2.0 for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants