The label of the dropdown does not render when its value is a list.
The callback works fine.
Running version 0.22.1
import dash
import dash_html_components as html
import dash_core_components as dcc
app = dash.Dash()
app.layout = html.Div([
dcc.Dropdown(
id='my-dropdown',
options=[
{'label': 'Option with a list', 'value': [1,2,3,4]},
{'label': 'Option with a string', 'value': 'New York'},
{'label': 'Option with an integer', 'value': 1}
],
value=1
),
html.Div(id='output-container')
])
@app.callback(
dash.dependencies.Output('output-container', 'children'),
[dash.dependencies.Input('my-dropdown', 'value')])
def update_output(value):
return 'The value is a "{}" with value {}'.format(type(value), value)
if __name__ == '__main__':
app.run_server(debug=True)
Hello, the problem still exists with newer versions. Tested it with dash version 1.2.0 and dash_core_components version 1.1.2. Fails the same way with tuples and numpy arrays.
Code I used
```python
import dash
import dash_core_components as dcc
import numpy as np
app = dash.Dash()
dd = dcc.Dropdown(options = [{'label': 'apples, bananas',
'value': ['apples', 'bananas']},
{'label': 'apples',
'value': ['apples']}],
value = 'apples',
style = {'width':'30%'},
id = 'dd')
md = dcc.Markdown(id = 'md')
app.layout = html.Div([dd,md])
@app.callback(Output('md','children'),
[Input('dd', 'value')])
def display_value(value):
return value
app.run_server(debug = False) # I work with Jupyter so I set debug to False
```
The label of the dropdown does not render when its value is a list. The callback works fine. Running version
0.22.1