Skip to content

Commit

Permalink
fix(number-input): add check for manually entered invalid value (#4817)
Browse files Browse the repository at this point in the history
  • Loading branch information
abbeyhrt authored and asudoh committed Dec 5, 2019
1 parent 155ebed commit fba393b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/react/src/components/NumberInput/NumberInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,12 @@ class NumberInput extends Component {
const inputWrapperProps = {};
let errorId = null;
let error = null;
if (invalid || (!allowEmpty && this.state.value === '')) {
if (
invalid ||
(!allowEmpty && this.state.value === '') ||
this.state.value > max ||
this.state.value < min
) {
inputWrapperProps['data-invalid'] = true;
errorId = `${id}-error-id`;
error = (
Expand Down

0 comments on commit fba393b

Please sign in to comment.