Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rares-nandra
Copy link

when providing keyboard input the values for isMax were inverted

@@ -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!')
Copy link
Author

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!')
Copy link
Author

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

Copy link
Author

@rares-nandra rares-nandra left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant