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

Commit

Permalink
Fix number inputs for IE11 (#730)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shammamah Hossain authored and Marc-Andre-Rivet committed Jan 21, 2020
1 parent a75f38e commit e513089
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
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

0 comments on commit e513089

Please sign in to comment.