Skip to content

Conversation

@Benzolitz
Copy link

Building upon @loicfevrier 's Pull request (#3).

  • Only compare the user input with the minValue, when focus is lost. Otherwise a positive minValue could lead to problems.
  • use parseFloat for comparision. "9" > "10" = true / 9 > 10 = false
  • check first if the value is nothing. Checking if a value even exists after using it is kinda strange to me.

Building upon @loicfevrier 's Pull request (#3).

- Only compare the user input with the minValue, when focus is lost. Otherwise a positive minValue could lead to problems.
- use parseFloat for comparision. "9" > "10" = true / 9 > 10 = false
- check first if the value is nothing. Checking if a value even exists after using it is kinda strange to me.
@EmKayDK
Copy link
Owner

EmKayDK commented Sep 18, 2015

Thanks (again) for the pull request.
Can you provide a configuration that will cause the error(s)?

Thanks in advance.

@Benzolitz
Copy link
Author

Point 1:

$('#txtTesting').jStepper({minValue: 10, maxValue: 20, minLength: 2});

After you typed in 10, try to change the number to 11. When I remove the 0 to add another 1, the script automatically changes the value to minValue. Only possiblities to change:

  • Be faster than the script
  • Copy & Paste the correct number
  • overwrite the 0
  • use mousewheel

Point 2:
I can't reproduce the error now, sorry. The problem was that I had a maxValue of 20 and when I typed in a 9 the script would change it to 20, because he would check if "9" > "20", which is true because both are strings.

Point 3:
Just a minor pet peeve of mine ^^.
https://github.com/EmKayDK/jstepper/blob/master/jquery.jstepper.js : Row 128

strValue < o.minValue && strValue != ''"

You first check strValue < minValue and then check if strValue even contains something. The logical order makes no sense for me.

Example:

strValue = "", minValue = 5

your code: check if strValue < minValue AND then check if strValue even contains something.
my code: check if string Value contains something.

EmKayDK added a commit that referenced this pull request Sep 19, 2015
Updating changelog and version number to 1.5.3.
New minified file.
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.

2 participants