Browse Source

make mobileinput event more reliable 2

Robin Herbots 12 years ago
parent
commit
9814a869e1
1 changed files with 6 additions and 3 deletions
  1. 6 3
      js/jquery.inputmask.js

+ 6 - 3
js/jquery.inputmask.js

@@ -1199,9 +1199,12 @@
                     keydownEvent.call(input, e);
                     keydownEvent.call(input, e);
                 } else { //nonnumerics don't fire keypress 
                 } else { //nonnumerics don't fire keypress 
                     checkVal(input, false, false);
                     checkVal(input, false, false);
-                    writeBuffer(input, getActiveBuffer(), seekNext(caretPos.begin - 1));
-                    if (isComplete(getActiveBuffer()) === true)
-                        $input.trigger("complete");
+                    writeBuffer(input, getActiveBuffer());
+                    setTimeout(function () {
+                        caret(input, seekNext(caretPos.begin - 1));
+                        if (isComplete(getActiveBuffer()) === true)
+                            $input.trigger("complete");
+                    }, 0);
                 }
                 }
             }
             }