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 all 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
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