Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Fix number inputs for IE11 #730

Merged
merged 9 commits into from
Jan 21, 2020
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Added responsiveness on graph parent element resize (previously only worked on window.resize)
- Added new `dash-graph--pending` class to dcc.Graph, present while resizing, (re-)rendering, loading

### Fixed
- [#731](https://github.com/plotly/dash-core-components/pull/731) Fixed bug in which input components with type `number` did not correctly update their values.
shammamah-zz marked this conversation as resolved.
Show resolved Hide resolved

### Changed
- [#723](https://github.com/plotly/dash-core-components/pull/723) Changed npm package content to allow source code inclusion from other projects
- [#725](https://github.com/plotly/dash-core-components/pull/725) Improve async graph performance by parallelizing resource fetching instead of fetching sequentially
Expand Down
9 changes: 6 additions & 3 deletions src/components/Input.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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,
Expand Down