Skip to content

Commit 179d895

Browse files
committed
Shouldn't need this android keypress workaround now.
1 parent c836559 commit 179d895

File tree

3 files changed

+1
-24
lines changed

3 files changed

+1
-24
lines changed

dist/jquery.maskedinput.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,6 @@
9898
}
9999
function keypressEvent(e) {
100100
var p, c, next, k = e.which, pos = input.caret();
101-
if (0 == k) {
102-
if (pos.begin >= len) return input.val(input.val().substr(0, len)), e.preventDefault(),
103-
!1;
104-
pos.begin == pos.end && (k = input.val().charCodeAt(pos.begin - 1), pos.begin--,
105-
pos.end--);
106-
}
107101
if (!(e.ctrlKey || e.altKey || e.metaKey || 32 > k) && k && 13 !== k) {
108102
if (pos.end - pos.begin !== 0 && (clearBuffer(pos.begin, pos.end), shiftL(pos.begin, pos.end - 1)),
109103
p = seekNext(pos.begin - 1), len > p && (c = String.fromCharCode(k), tests[p].test(c))) {

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.

src/jquery.maskedinput.js

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -236,23 +236,6 @@ $.fn.extend({
236236
c,
237237
next;
238238

239-
if (k == 0) {
240-
// unable to detect key pressed. Grab it from pos and adjust
241-
// this is a failsafe for mobile chrome
242-
// which can't detect keypress events
243-
// reliably
244-
if (pos.begin >= len) {
245-
input.val(input.val().substr(0, len));
246-
e.preventDefault();
247-
return false;
248-
}
249-
if (pos.begin == pos.end) {
250-
k = input.val().charCodeAt(pos.begin - 1);
251-
pos.begin--;
252-
pos.end--;
253-
}
254-
}
255-
256239
if (e.ctrlKey || e.altKey || e.metaKey || k < 32) {//Ignore
257240
return;
258241
} else if ( k && k !== 13 ) {

0 commit comments

Comments
 (0)