Skip to content

Commit

Permalink
fix(NumberPicker): support null to clear value. relate #780
Browse files Browse the repository at this point in the history
  • Loading branch information
bindoon committed Jun 13, 2019
1 parent ba8083c commit 15ae286
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/number-picker/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,9 @@ class NumberPicker extends React.Component {

componentWillReceiveProps(nextProps) {
if ('value' in nextProps) {
const value = nextProps.value;
this.setState({
value: nextProps.value === undefined ? '' : nextProps.value,
value: value === undefined || value === null ? '' : value,
});
}
}
Expand Down

0 comments on commit 15ae286

Please sign in to comment.