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

Commit 8805a33

Browse files
committed
Remove default min/max
1 parent 1718ec2 commit 8805a33

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/InputNumeric.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ const propTypes = {
1414

1515
const defaultProps = {
1616
step: 1,
17-
min: 0,
18-
max: 100,
17+
min: null,
18+
max: null,
1919
decimals: 0,
2020
onBlur: null,
2121
onChange: null
@@ -90,10 +90,10 @@ export default class InputNumeric extends Component {
9090
return this.state.newValue;
9191
}
9292
const newNumber = parseFloat(newValue);
93-
if (newNumber <= this.props.min) {
93+
if (this.props.min && newNumber <= this.props.min) {
9494
// value is min or smaller: set to min
9595
return this.props.min;
96-
} else if (newNumber >= this.props.max) {
96+
} else if (this.props.max && newNumber >= this.props.max) {
9797
// value is max or larger: set to max
9898
return this.props.max;
9999
} else {

0 commit comments

Comments
 (0)