From 86640894a3a468487f1abf167f43de84aca4e336 Mon Sep 17 00:00:00 2001 From: Ann Marie Ward Date: Fri, 29 Jan 2021 15:15:54 -0700 Subject: [PATCH 1/4] sets autoComplete to off in Dropdown #808 --- src/fragments/Dropdown.react.js | 2 ++ tests/unit/Dropdown.test.js | 1 + 2 files changed, 3 insertions(+) diff --git a/src/fragments/Dropdown.react.js b/src/fragments/Dropdown.react.js index 15b0b93cf..a0e61d2b5 100644 --- a/src/fragments/Dropdown.react.js +++ b/src/fragments/Dropdown.react.js @@ -54,6 +54,7 @@ export default class Dropdown extends Component { style, loading_state, value, + inputProps, } = this.props; const {filterOptions} = this.state; let selectedValue; @@ -97,6 +98,7 @@ export default class Dropdown extends Component { onInputChange={search_value => setProps({search_value})} backspaceRemoves={clearable} deleteRemoves={clearable} + inputProps={{...inputProps, autoComplete: 'off'}} {...omit(['setProps', 'value'], this.props)} /> diff --git a/tests/unit/Dropdown.test.js b/tests/unit/Dropdown.test.js index c10fd24d3..a1570f562 100644 --- a/tests/unit/Dropdown.test.js +++ b/tests/unit/Dropdown.test.js @@ -18,6 +18,7 @@ describe('Props can be set properly', () => { {label: 'Disabled', value: 'x', disabled: true}, ], value: 2, + autoComplete: 'off', optionHeight: 50, className: 'dd-class', clearable: true, From 1c12151a2f9e0c85ad7321dbe25ea94442d8993f Mon Sep 17 00:00:00 2001 From: AnnMarieW <72614349+AnnMarieW@users.noreply.github.com> Date: Sat, 30 Jan 2021 16:40:17 -0700 Subject: [PATCH 2/4] Update src/fragments/Dropdown.react.js Co-authored-by: Alex Johnson --- src/fragments/Dropdown.react.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fragments/Dropdown.react.js b/src/fragments/Dropdown.react.js index a0e61d2b5..147ef762b 100644 --- a/src/fragments/Dropdown.react.js +++ b/src/fragments/Dropdown.react.js @@ -98,7 +98,7 @@ export default class Dropdown extends Component { onInputChange={search_value => setProps({search_value})} backspaceRemoves={clearable} deleteRemoves={clearable} - inputProps={{...inputProps, autoComplete: 'off'}} + inputProps={{autoComplete: 'off'}} {...omit(['setProps', 'value'], this.props)} /> From d83e1313af2cdf176e996791bd4c7cab267a281e Mon Sep 17 00:00:00 2001 From: Ann Marie Ward Date: Sat, 30 Jan 2021 18:36:36 -0700 Subject: [PATCH 3/4] fixed props --- src/fragments/Dropdown.react.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/fragments/Dropdown.react.js b/src/fragments/Dropdown.react.js index 147ef762b..2f819b353 100644 --- a/src/fragments/Dropdown.react.js +++ b/src/fragments/Dropdown.react.js @@ -54,7 +54,6 @@ export default class Dropdown extends Component { style, loading_state, value, - inputProps, } = this.props; const {filterOptions} = this.state; let selectedValue; From f0a61a3de8cf58efd780b9276348b837a3328964 Mon Sep 17 00:00:00 2001 From: Ann Marie Ward Date: Mon, 1 Feb 2021 10:20:32 -0700 Subject: [PATCH 4/4] Changelog entry --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd14fe9f6..1a1997c56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## UNRELEASED + +### Changed +- [#923](https://github.com/plotly/dash-core-components/pull/923) + Set autoComplete to off in `dcc.Dropdown`. This fixes [#808](https://github.com/plotly/dash-core-components/issues/808) + ## [1.15.0] - 2021-01-19 ### Fixed - [#905](https://github.com/plotly/dash-core-components/pull/905) Make sure the `figure` prop of `dcc.Graph` receives updates from user interactions in the graph, by using the same `layout` object as provided in the prop rather than cloning it. Fixes [#879](https://github.com/plotly/dash-core-components/issues/879).