Skip to content

Commit

Permalink
fix(NumberPicker): fix display valueunder controlled. fix #1163
Browse files Browse the repository at this point in the history
  • Loading branch information
bindoon committed Sep 29, 2019
1 parent 6edc9a6 commit 7207532
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/number-picker/number-picker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,15 @@ class NumberPicker extends React.Component {
}

if (`${val}` !== `${value}`) {
// under controled, set back to props.value
if (
'value' in this.props &&
`${this.props.value}` !== `${this.state.value}`
) {
this.setState({
value: this.props.value,
});
}
this.onCorrect(val, value);
}

Expand Down

0 comments on commit 7207532

Please sign in to comment.