Browse Source

fix clearincomplete

Robin Herbots 12 years ago
parent
commit
6613860e0d
1 changed files with 6 additions and 0 deletions
  1. 6 0
      js/jquery.inputmask.js

+ 6 - 0
js/jquery.inputmask.js

@@ -819,6 +819,12 @@
                     if (!isComplete(buffer)) {
                         $input.trigger("incomplete");
                         if (opts.clearIncomplete) {
+                         	$.each(masksets, function (ndx, ms) {
+                    			ms["buffer"] = ms["_buffer"].slice();
+                    			ms["lastValidPosition"] = undefined;
+                    			ms["p"] = isRTL ? getMaskLength() : 0;
+                			});
+                			activeMasksetIndex = 0;
                             if (opts.clearMaskOnLostFocus)
                                 input._valueSet('');
                             else {