File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ export class InputService {
49
49
}
50
50
51
51
clearMask ( rawValue : string ) : number {
52
-
52
+
53
53
if ( this . isNullable ( ) && rawValue === "" )
54
54
return null ;
55
55
@@ -81,7 +81,7 @@ export class InputService {
81
81
this . rawValue = null ;
82
82
return ;
83
83
}
84
-
84
+
85
85
let selectionEnd = this . inputSelection . selectionEnd ;
86
86
let selectionStart = this . inputSelection . selectionStart ;
87
87
@@ -90,10 +90,11 @@ export class InputService {
90
90
selectionStart = this . rawValue . length - this . options . suffix . length ;
91
91
}
92
92
93
+ const move = this . rawValue . substr ( selectionStart - 1 , 1 ) . match ( / \d / ) ? 0 : 1 ;
93
94
selectionEnd = keyCode == 46 || keyCode == 63272 ? selectionEnd + 1 : selectionEnd ;
94
95
selectionStart = keyCode == 8 ? selectionStart - 1 : selectionStart ;
95
96
this . rawValue = this . rawValue . substring ( 0 , selectionStart ) + this . rawValue . substring ( selectionEnd , this . rawValue . length ) ;
96
- this . updateFieldValue ( selectionStart ) ;
97
+ this . updateFieldValue ( selectionStart - move ) ;
97
98
}
98
99
99
100
updateFieldValue ( selectionStart ?: number ) : void {
You can’t perform that action at this time.
0 commit comments