Bug in Dynamic Options example

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 dcc.Dropdown | Dash for Python Documentation | Plotly 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.