-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issue-94: isMax inverted for keyboard input #95
base: master
Are you sure you want to change the base?
Fix issue-94: isMax inverted for keyboard input #95
Conversation
…he on limit reached callback
@@ -127,10 +127,10 @@ export default class NumericInput extends Component { | |||
let legal = match && match[0] === match.input && ((this.props.maxValue === null || (parseFloat(this.state.stringValue) <= this.props.maxValue)) && (this.props.minValue === null || (parseFloat(this.state.stringValue) >= this.props.minValue))) | |||
if (!legal) { | |||
if (this.props.minValue !== null && (parseFloat(this.state.stringValue) <= this.props.minValue)) { | |||
this.props.onLimitReached(true, 'Reached Minimum Value!') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the minimum value is reached, isMax should be false
} | ||
if (this.props.maxValue !== null && (parseFloat(this.state.stringValue) >= this.props.maxValue)) { | ||
this.props.onLimitReached(false, 'Reached Maximum Value!') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the maximum value is reached, isMax should be true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added comments describing the changes
when providing keyboard input the values for isMax were inverted