Robin Herbots 11 年 前
コミット
6aa0a535a3
1 ファイル変更5 行追加3 行削除
  1. 5 3
      js/jquery.inputmask.js

+ 5 - 3
js/jquery.inputmask.js

@@ -1184,10 +1184,15 @@
 
 
             function mobileInputEvent(e) {
             function mobileInputEvent(e) {
                 var input = this, $input = $(input);
                 var input = this, $input = $(input);
+				input.focus();
 
 
                 //backspace in chrome32 only fires input event - detect & treat
                 //backspace in chrome32 only fires input event - detect & treat
                 var caretPos = caret(input),
                 var caretPos = caret(input),
                     currentValue = input._valueGet();
                     currentValue = input._valueGet();
+                    
+                console.log(currentValue);
+                currentValue = currentValue.replace(new RegExp("(" + escapeRegex(getActiveBufferTemplate().join('')) + ")*"), "");
+                console.log(currentValue);    
                 //correct caretposition for chrome
                 //correct caretposition for chrome
                 if (caretPos.begin > currentValue.length) {
                 if (caretPos.begin > currentValue.length) {
                     caret(input, currentValue.length);
                     caret(input, currentValue.length);
@@ -1199,9 +1204,6 @@
                     e.keyCode = opts.keyCode.BACKSPACE;
                     e.keyCode = opts.keyCode.BACKSPACE;
                     keydownEvent.call(input, e);
                     keydownEvent.call(input, e);
                 } else { //nonnumerics don't fire keypress 
                 } else { //nonnumerics don't fire keypress 
-                    console.log(currentValue);
-                    currentValue = currentValue.replace(new RegExp("(" + escapeRegex(getActiveBufferTemplate().join('')) + ")*"), "");
-                    console.log(currentValue);
                     checkVal(input, false, false, currentValue.split(''));
                     checkVal(input, false, false, currentValue.split(''));
                     writeBuffer(input, getActiveBuffer());
                     writeBuffer(input, getActiveBuffer());
                     if (isComplete(getActiveBuffer()) === true)
                     if (isComplete(getActiveBuffer()) === true)