Skip to content

Commit cb9c152

Browse files
author
Igor Escobar
committed
fixing caret on android with chrome 28
1 parent db1ba55 commit cb9c152

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/jquery.mask.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@
217217
var newVal = p.getMasked(),
218218
caretPos = p.getCaret();
219219

220-
// we got to adjust the cursor in here to avoid android glitches
221220
setTimeout(function(caretPos, newVal) {
222221
p.setCaret(p.calculateCaretPosition(caretPos, newVal));
223222
}, 10, caretPos, newVal);
@@ -512,7 +511,8 @@
512511
dataMask: true,
513512
watchInterval: 300,
514513
watchInputs: true,
515-
useInput: eventSupported('input'),
514+
// old versions of chrome dont work great with input event
515+
useInput: !/Chrome\/28/.test(window.navigator.userAgent) && eventSupported('input'),
516516
watchDataMask: false,
517517
byPassKeys: [9, 16, 17, 18, 36, 37, 38, 39, 40, 91],
518518
translation: {
@@ -538,3 +538,4 @@
538538
}
539539
}, globals.watchInterval);
540540
}, window.jQuery, window.Zepto));
541+

0 commit comments

Comments
 (0)