@@ -125,6 +125,7 @@ export class IgxMaskDirective implements OnInit, AfterViewChecked, ControlValueA
125
125
private _key : number ;
126
126
private _oldText = '' ;
127
127
private _dataValue = '' ;
128
+ private _focused = false ;
128
129
private _droppedData : string ;
129
130
private _hasDropAction : boolean ;
130
131
private _stopPropagation : boolean ;
@@ -222,26 +223,32 @@ export class IgxMaskDirective implements OnInit, AfterViewChecked, ControlValueA
222
223
/** @hidden */
223
224
@HostListener ( 'focus' )
224
225
public onFocus ( ) : void {
226
+ this . _focused = true ;
225
227
this . showMask ( this . _dataValue ) ;
226
228
}
227
229
228
230
/** @hidden */
229
231
@HostListener ( 'blur' , [ '$event.target.value' ] )
230
232
public onBlur ( value : string ) : void {
233
+ this . _focused = false ;
231
234
this . showDisplayValue ( value ) ;
232
235
this . _onTouchedCallback ( ) ;
233
236
}
234
237
235
238
/** @hidden */
236
239
@HostListener ( 'dragenter' )
237
240
public onDragEnter ( ) : void {
238
- this . showMask ( this . _dataValue ) ;
241
+ if ( ! this . _focused ) {
242
+ this . showMask ( this . _dataValue ) ;
243
+ }
239
244
}
240
245
241
246
/** @hidden */
242
247
@HostListener ( 'dragleave' )
243
248
public onDragLeave ( ) : void {
244
- this . showDisplayValue ( this . inputValue ) ;
249
+ if ( ! this . _focused ) {
250
+ this . showDisplayValue ( this . inputValue ) ;
251
+ }
245
252
}
246
253
247
254
/** @hidden */
@@ -257,6 +264,7 @@ export class IgxMaskDirective implements OnInit, AfterViewChecked, ControlValueA
257
264
if ( isIE ( ) ) {
258
265
this . _stopPropagation = true ;
259
266
}
267
+ // TODO(D.P.): focusedValuePipe should be deprecated or force-checked to match mask format
260
268
this . inputValue = this . focusedValuePipe . transform ( value ) ;
261
269
} else {
262
270
this . inputValue = this . maskParser . applyMask ( this . inputValue , this . maskOptions ) ;
0 commit comments