Quantcast
Channel: 🎛️ Dash - Plotly Community Forum
Viewing all articles
Browse latest Browse all 6271

Bug in Dynamic Options example

$
0
0

In July I posted Multi dcc.Dropdown issue which got no responses and struggling with Possible bug in dcc.Dropdown figured out the problem and that it comes from the Dynamic Options example on https://dash.plotly.com/dash-core-components/dropdown I am building from.

The problem lies in that with

def update_multi_options(search_value, value):
    if not search_value:
        raise PreventUpdate

every time you refresh your page, search_value is None and the PreventUpdate causes the previously selected value options to be gone until you tinker with the dropdown again.

The hacky fix I implemented is:

def update_multi_options(search_value, value):
    if not search_value:
        search_value = '_UNMATCHABLE_STRING_'

so then there are no matches and the existing value items do appear because they get properly returned. Of course the example can be improved to return the values there and not fall through the search code.

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 6271

Trending Articles