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 187187
188188 return r ;
189189 } ,
190- calculateCaretPosition : function ( ) {
191- var oldVal = el . data ( 'mask-previus-value' ) || '' ,
192- newVal = p . getMasked ( ) ,
190+ calculateCaretPosition : function ( oldVal = '' ) {
191+ var newVal = p . getMasked ( ) ,
193192 caretPosNew = p . getCaret ( ) ;
194193 if ( oldVal !== newVal ) {
195194 var caretPosOld = el . data ( 'mask-previus-caret-pos' ) || 0 ,
255254
256255 if ( $ . inArray ( keyCode , jMask . byPassKeys ) === - 1 ) {
257256 var newVal = p . getMasked ( ) ,
258- caretPos = p . getCaret ( ) ;
257+ caretPos = p . getCaret ( ) ,
258+ oldVal = el . data ( 'mask-previus-value' ) ;
259259
260260 // this is a compensation to devices/browsers that don't compensate
261261 // caret positioning the right way
262262 setTimeout ( function ( ) {
263- p . setCaret ( p . calculateCaretPosition ( ) ) ;
263+ p . setCaret ( p . calculateCaretPosition ( oldVal ) ) ;
264264 } , $ . jMaskGlobals . keyStrokeCompensation ) ;
265265
266266 p . val ( newVal ) ;
You can’t perform that action at this time.
0 commit comments