Browse Source

correct greedy setting if needed

Robin Herbots 13 years ago
parent
commit
0441a8b009
1 changed files with 3 additions and 0 deletions
  1. 3 0
      js/jquery.inputmask.js

+ 3 - 0
js/jquery.inputmask.js

@@ -533,6 +533,9 @@
                 var $input = $(el);
                 var $input = $(el);
                 if (!$input.is(":input")) return;
                 if (!$input.is(":input")) return;
 
 
+      		//correct greedy setting if needed
+                opts.greedy = opts.greedy && opts.repeat > 0;
+
                 //handle maxlength attribute
                 //handle maxlength attribute
                 var maxLength = $input.prop('maxLength');
                 var maxLength = $input.prop('maxLength');
                 if (getMaskLength() > maxLength && maxLength > -1) { //FF sets no defined max length to -1 
                 if (getMaskLength() > maxLength && maxLength > -1) { //FF sets no defined max length to -1