diff --git a/CHANGELOG.md b/CHANGELOG.md index bef59a2111..1bec144b99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,9 @@ This project adheres to [Semantic Versioning](https://semver.org/). ### Fixed + +### Fixed +- [#1958](https://github.com/plotly/dash/pull/1958) Fix dropdown bug [#1908](https://github.com/plotly/dash/issues/1908) where the value didn't display in the input box if it contained a comma. - [#1915](https://github.com/plotly/dash/pull/1915) Fix bug [#1474](https://github.com/plotly/dash/issues/1474) when both dcc.Graph and go.Figure have animation, and when the second animation in Figure is executed, the Frames from the first animation are played instead of the second one. - [#1953](https://github.com/plotly/dash/pull/1953) Fix bug [#1783](https://github.com/plotly/dash/issues/1783) in which a failed hot reloader blocks the UI with alerts. diff --git a/components/dash-core-components/src/fragments/Dropdown.react.js b/components/dash-core-components/src/fragments/Dropdown.react.js index 43dd15e006..1ee7dab49f 100644 --- a/components/dash-core-components/src/fragments/Dropdown.react.js +++ b/components/dash-core-components/src/fragments/Dropdown.react.js @@ -1,4 +1,4 @@ -import {isNil, pluck, omit, type} from 'ramda'; +import {isNil, pluck, omit} from 'ramda'; import React, {Component} from 'react'; import ReactDropdown from 'react-virtualized-select'; import createFilterOptions from 'react-select-fast-filter-options'; @@ -21,8 +21,6 @@ const TOKENIZER = { }, }; -const DELIMITER = ','; - export default class Dropdown extends Component { constructor(props) { super(props); @@ -57,12 +55,6 @@ export default class Dropdown extends Component { value, } = this.props; const {filterOptions} = this.state; - let selectedValue; - if (type(value) === 'Array') { - selectedValue = value.join(DELIMITER); - } else { - selectedValue = value; - } return (
{ if (multi) { let value; diff --git a/components/dash-core-components/tests/integration/dropdown/test_dynamic_options.py b/components/dash-core-components/tests/integration/dropdown/test_dynamic_options.py index 85d9985579..eebf3b6f3e 100644 --- a/components/dash-core-components/tests/integration/dropdown/test_dynamic_options.py +++ b/components/dash-core-components/tests/integration/dropdown/test_dynamic_options.py @@ -54,23 +54,18 @@ def update_options(search_value): def test_dddo002_array_value(dash_dcc): - dropdown_options = [ - {"label": "New York City", "value": "New,York,City"}, - {"label": "Montreal", "value": "Montreal"}, - {"label": "San Francisco", "value": "San,Francisco"}, - ] app = Dash(__name__) - arrayValue = ["San", "Francisco"] dropdown = dcc.Dropdown( - options=dropdown_options, - value=arrayValue, + options=["New York, NY", "Montreal, QC", "San Francisco, CA"], + value=["San Francisco, CA"], + multi=True, ) - app.layout = html.Div([dropdown]) + app.layout = html.Div(dropdown) dash_dcc.start_server(app) - dash_dcc.wait_for_text_to_equal("#react-select-2--value-item", "San Francisco") + dash_dcc.wait_for_text_to_equal("#react-select-2--value-0", "San Francisco, CA\n ") assert dash_dcc.get_logs() == []