Browse Source

fix overtyping of 0

Robin Herbots 12 years ago
parent
commit
835cf0a1ce
1 changed files with 1 additions and 1 deletions
  1. 1 1
      js/jquery.inputmask.numeric.extensions.js

+ 1 - 1
js/jquery.inputmask.numeric.extensions.js

@@ -109,7 +109,7 @@ Optional extensions on the jquery.inputmask base
                 '~': { //real number
                     validator: function (chrs, buffer, pos, strict, opts) {
                         if (chrs == "") return false;
-                        if (!strict && pos <= 1 && buffer[0] === '0' && new RegExp("[\\d-]").test(chrs) && buffer.length == 1) { //handle first char
+                        if (!strict && pos <= 1 && buffer[0] === '0' && new RegExp("[\\d-]").test(chrs) && buffer.join('').length == 1) { //handle first char
                             buffer[0] = "";
                             return { "pos": 0 };
                         }