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

Commit e513089

Browse files
Shammamah HossainMarc-Andre-Rivet
Shammamah Hossain
authored andcommitted
Fix number inputs for IE11 (#730)
1 parent a75f38e commit e513089

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
2020
- Added new `dash-graph--pending` class to dcc.Graph, present while resizing, (re-)rendering, loading
2121

2222
### Fixed
23+
- [#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.
2324
- [#731](https://github.com/plotly/dash-core-components/pull/731) Fixed bug where non-clearable dropdowns could still be cleared by typing backspace
2425

2526
### Changed

src/components/Input.react.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ export default class Input extends PureComponent {
3131
}
3232

3333
componentWillReceiveProps(nextProps) {
34-
const {value, valueAsNumber} = this.input.current;
34+
const {value} = this.input.current;
35+
const valueAsNumber = convert(value);
3536
this.setInputValue(
3637
isNil(valueAsNumber) ? value : valueAsNumber,
3738
nextProps.value
@@ -42,7 +43,8 @@ export default class Input extends PureComponent {
4243
}
4344

4445
componentDidMount() {
45-
const {value, valueAsNumber} = this.input.current;
46+
const {value} = this.input.current;
47+
const valueAsNumber = convert(value);
4648
this.setInputValue(
4749
isNil(valueAsNumber) ? value : valueAsNumber,
4850
this.props.value
@@ -109,7 +111,8 @@ export default class Input extends PureComponent {
109111
}
110112

111113
onEvent() {
112-
const {value, valueAsNumber} = this.input.current;
114+
const {value} = this.input.current;
115+
const valueAsNumber = convert(value);
113116
if (this.props.type === 'number') {
114117
this.setPropValue(
115118
this.props.value,

0 commit comments

Comments
 (0)