File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 187
187
188
188
return r ;
189
189
} ,
190
- calculateCaretPosition : function ( ) {
191
- var oldVal = el . data ( 'mask-previus-value' ) || '' ,
192
- newVal = p . getMasked ( ) ,
190
+ calculateCaretPosition : function ( oldVal = '' ) {
191
+ var newVal = p . getMasked ( ) ,
193
192
caretPosNew = p . getCaret ( ) ;
194
193
if ( oldVal !== newVal ) {
195
194
var caretPosOld = el . data ( 'mask-previus-caret-pos' ) || 0 ,
255
254
256
255
if ( $ . inArray ( keyCode , jMask . byPassKeys ) === - 1 ) {
257
256
var newVal = p . getMasked ( ) ,
258
- caretPos = p . getCaret ( ) ;
257
+ caretPos = p . getCaret ( ) ,
258
+ oldVal = el . data ( 'mask-previus-value' ) ;
259
259
260
260
// this is a compensation to devices/browsers that don't compensate
261
261
// caret positioning the right way
262
262
setTimeout ( function ( ) {
263
- p . setCaret ( p . calculateCaretPosition ( ) ) ;
263
+ p . setCaret ( p . calculateCaretPosition ( oldVal ) ) ;
264
264
} , $ . jMaskGlobals . keyStrokeCompensation ) ;
265
265
266
266
p . val ( newVal ) ;
You can’t perform that action at this time.
0 commit comments