diff --git a/CHANGELOG.md b/CHANGELOG.md index 8cfaf2c3f..24bba3218 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Added new `dash-graph--pending` class to dcc.Graph, present while resizing, (re-)rendering, loading ### Fixed +- [#730](https://github.com/plotly/dash-core-components/pull/730) Fixed bug in which input components with type `number` did not correctly update their values. - [#731](https://github.com/plotly/dash-core-components/pull/731) Fixed bug where non-clearable dropdowns could still be cleared by typing backspace ### Changed diff --git a/src/components/Input.react.js b/src/components/Input.react.js index 4d7f6727f..50304459f 100644 --- a/src/components/Input.react.js +++ b/src/components/Input.react.js @@ -31,7 +31,8 @@ export default class Input extends PureComponent { } componentWillReceiveProps(nextProps) { - const {value, valueAsNumber} = this.input.current; + const {value} = this.input.current; + const valueAsNumber = convert(value); this.setInputValue( isNil(valueAsNumber) ? value : valueAsNumber, nextProps.value @@ -42,7 +43,8 @@ export default class Input extends PureComponent { } componentDidMount() { - const {value, valueAsNumber} = this.input.current; + const {value} = this.input.current; + const valueAsNumber = convert(value); this.setInputValue( isNil(valueAsNumber) ? value : valueAsNumber, this.props.value @@ -109,7 +111,8 @@ export default class Input extends PureComponent { } onEvent() { - const {value, valueAsNumber} = this.input.current; + const {value} = this.input.current; + const valueAsNumber = convert(value); if (this.props.type === 'number') { this.setPropValue( this.props.value,