Skip to content

Commit 68fcf26

Browse files
author
Igor Escobar
committed
rolling back change to fix caret positioning. it didn’t worked on some devices
1 parent d27f8b0 commit 68fcf26

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/jquery.mask.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,8 @@
254254
var keyCode = el.data('mask-keycode');
255255

256256
if ($.inArray(keyCode, jMask.byPassKeys) === -1) {
257-
var newVal = p.getMasked();
257+
var newVal = p.getMasked(),
258+
caretPos = p.getCaret();
258259

259260
// this is a compensation to devices/browsers that don't compensate
260261
// caret positioning the right way
@@ -263,6 +264,7 @@
263264
}, $.jMaskGlobals.keyStrokeCompensation);
264265

265266
p.val(newVal);
267+
p.setCaret(caretPos);
266268
return p.callbacks(e);
267269
}
268270
},

0 commit comments

Comments
 (0)