Skip to content

Conversation

miguel-s
Copy link
Contributor

Contributing to #557

Fixes two bugs with number input in filters:

  • when input has a negative number (to reproduce in master: typing a "-" char will lead to "NaN" being displayed)
  • when input is empty (to reproduce in master: typing a valid number and deleting with backspace will lead to "NaN" being displayed)

Copy link
Contributor

@natanrolnik natanrolnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, besides the note that I left.
Also, please add a line describing the change, mentioning this PR in the Changelog file.

value={value}
onChange={(e) => {
let val = value;
if (!e.target.value.length) val = '';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't use if and else without brackets. This might lead to bugs. And already did in the history of programming many times :) Also, don't keep the val assignment in the same line.

@miguel-s
Copy link
Contributor Author

@natanrolnik fixed the formatting and added the line to the Changelog file

@flovilmart
Copy link
Contributor

LGTM! Thanks!

@natanrolnik natanrolnik merged commit fcd9e51 into parse-community:master Jul 14, 2017
@pgiguere1
Copy link
Contributor

This seems to have broken number filtering entirely for any 1-digit number.

#831

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.

4 participants