Skip to content

Commit 5970a2a

Browse files
author
Marco Cesarato
committed
fix: on change within range from keyboard
Closes: #49
1 parent 8c56076 commit 5970a2a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/InputSpinner.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,8 @@ class InputSpinner extends Component {
309309

310310
if (isEmptyValue && this.isEmptied()) {
311311
num = parsedNum = null;
312+
} else {
313+
num = this._withinRange(num);
312314
}
313315

314316
if (this.state.value !== num && isCallable(this.props.onChange)) {
@@ -322,11 +324,7 @@ class InputSpinner extends Component {
322324
}
323325
}
324326

325-
if (!isEmptyValue) {
326-
this.setState({value: num});
327-
} else {
328-
this.setState({value: value});
329-
}
327+
this.setState({value: num});
330328
}
331329

332330
/**

0 commit comments

Comments
 (0)