Skip to content

Dev-tools UI - dropdown options bug #708

@OwenLund

Description

@OwenLund

Hi, I believe I've found some unexpected behavior with the new dev-tools UI feature.

When a dropdown's options contains a null/NaN value - an error appears in the new UI and the dropdown is not rendered in the browser (however no errors are shown in the console). If the app is run with debug=False, the dropdown renders and the nan value appears in the options (but cannot be selected?).

Unfortunately I'm not sure what the expected behavior should be in this scenario - or if this is a valid issue. Please feel free to remove if not.

import dash
import dash_core_components as dcc
import dash_html_components as html
import numpy as np
import pandas as pd

external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)

dropdown_list = pd.Series([1,2,3,np.nan])

app.layout = html.Div(children=[
    dcc.Dropdown(
        id='dropdown',
        options=[{'label':f"Option: {i}", 'value':i} for i in dropdown_list]
    )
])

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions