Skip to content

Commit a4308ea

Browse files
committed
Rebuilding distribution files after merging from upsteam/master.
1 parent 4c5253f commit a4308ea

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

dist/jquery.maskedinput.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
var pasteEventName = getPasteEvent() + ".mask",
1616
ua = navigator.userAgent,
1717
iPhone = /iphone/i.test(ua),
18+
chrome = /chrome/i.test(ua),
1819
android=/android/i.test(ua),
1920
caretTimeoutId;
2021

@@ -205,6 +206,22 @@ $.fn.extend({
205206
c,
206207
next;
207208

209+
if (k == 0) {
210+
// unable to detect key pressed. Grab it from pos and adjust
211+
// this is a failsafe for mobile chrome
212+
// which can't detect keypress events
213+
// reliably
214+
if (pos.begin >= len) {
215+
input.val(input.val().substr(0, len));
216+
e.preventDefault();
217+
return false;
218+
}
219+
if (pos.begin == pos.end) {
220+
k = input.val().charCodeAt(pos.begin - 1);
221+
pos.begin--;
222+
pos.end--;
223+
}
224+
}
208225
if (e.ctrlKey || e.altKey || e.metaKey || k < 32) {//Ignore
209226
return;
210227
} else if (k) {
@@ -342,11 +359,12 @@ $.fn.extend({
342359
settings.completed.call(input);
343360
}, 0);
344361
});
345-
362+
if (chrome && android) {
363+
input.bind("keyup.mask", keypressEvent);
364+
}
346365
checkVal(); //Perform initial check for existing values
347366
});
348367
}
349368
});
350369

351-
352370
})(jQuery);

dist/jquery.maskedinput.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)