Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of github.com:LeaVerou/Incrementable

  • Loading branch information...
commit ca2cd43c98499a71b4f93c9f160715fffa604e81 2 parents 990c1e1 + 6bda62a
@LeaVerou authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 incrementable.js
View
4 incrementable.js
@@ -48,7 +48,9 @@ var _ = window.Incrementable = function(textField, multiplier, units) {
this[property] = this[property].replace(regex, function($0, $1, $2) {
if($1.length <= caret && $1.length + $2.length >= caret) {
me.changed = true;
- return $1 + me.stepValue($2, evt.keyCode == 40, multiplier);
+ var stepValue = me.stepValue($2, evt.keyCode == 40, multiplier);
+ caret = caret + (stepValue.length - $2.length);
+ return $1 + stepValue;
}
else {
return $1 + $2;
Please sign in to comment.
Something went wrong with that request. Please try again.