Browse Source

Merge branch 'dev' into optional

Robin Herbots 13 years ago
parent
commit
ce8622bca0
2 changed files with 4 additions and 2 deletions
  1. 1 1
      js/jquery.inputmask.js
  2. 3 1
      js/jquery.inputmask.numeric.extensions.js

+ 1 - 1
js/jquery.inputmask.js

@@ -621,8 +621,8 @@
                     if (opts.greedy == false) {
                         opts.repeat = Math.round(maxLength / getActiveBuffer().length);
                     }
+                    $input.prop('maxLength', getMaskLength() * 2);
                 }
-                $input.prop('maxLength', getMaskLength() * 2);
 
                 //store tests & original buffer in the input element - used to get the unmasked value
                 $input.data('inputmask', {

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

@@ -34,7 +34,9 @@ Optional extensions on the jquery.inputmask base
                         for (var i = 1; i < opts.digits; i++) {
                             if (nptStr[radixPosition + i]) nptStr = nptStr + "0";
                         }
-                        $input.val(nptStr);
+                        if (nptStr !== $input.val()) {
+                        	$input.val(nptStr);
+                        }
                     }
                 }
             },