Browse Source

remove settimeout in applying the mask

Robin Herbots 14 years ago
parent
commit
6220d47712
1 changed files with 7 additions and 8 deletions
  1. 7 8
      jquery.inputmask.js

+ 7 - 8
jquery.inputmask.js

@@ -600,14 +600,13 @@ This plugin is based on the masked input plugin written by Josh Bush (digitalbus
                 });
                 });
                 }
                 }
 
 
-                setTimeout(function() {
-                    lastPosition = checkVal(el, buffer, true);
-                    if (document.activeElement === el) { //position the caret when in focus
-                        $input.addClass('focus.inputmask');
-                        caret(el, lastPosition);
-                    } else if (opts.clearMaskOnLostFocus && el._valueGet() == _buffer.join(''))
-                        el._valueSet('');
-                }, 0);
+                //apply mask
+                lastPosition = checkVal(el, buffer, true);
+                if (document.activeElement === el) { //position the caret when in focus
+                  $input.addClass('focus.inputmask');
+                  caret(el, lastPosition);
+                } else if (opts.clearMaskOnLostFocus && el._valueGet() == _buffer.join(''))
+                      el._valueSet('');
 
 
                 //private functions
                 //private functions
                 function patchValueProperty(npt) {
                 function patchValueProperty(npt) {