Skip to content

Commit

Permalink
fix(NumberPicker): repair numberPicker log string, close #3768 (#3769)
Browse files Browse the repository at this point in the history
  • Loading branch information
weinianyang authored and 潕量 committed Mar 25, 2022
1 parent 2877a88 commit d68df7f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/number-picker/number-picker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -427,12 +427,16 @@ class NumberPicker extends React.Component {
return onDisabled(e);
}

const value = this.state.value;
let value = this.state.value;
// 受控下,可能强制回填非法值
if (isNaN(value)) {
return;
}

if (value === '' && !this.props.stringMode) {
value = 0;
}

let val = this[`${type}Step`](value);
val = this.correctBoundary(val);
// 受控下,显示的值应为受控value
Expand Down

0 comments on commit d68df7f

Please sign in to comment.