@@ -99,6 +99,7 @@ export class IgxInputDirective implements AfterViewInit, OnDestroy {
99
99
100
100
private _valid = IgxInputState . INITIAL ;
101
101
private _statusChanges$ : Subscription ;
102
+ private _valueChanges$ : Subscription ;
102
103
private _fileNames : string ;
103
104
private _disabled = false ;
104
105
@@ -305,6 +306,10 @@ export class IgxInputDirective implements AfterViewInit, OnDestroy {
305
306
this . _statusChanges$ = this . ngControl . statusChanges . subscribe (
306
307
this . onStatusChanged . bind ( this )
307
308
) ;
309
+
310
+ this . _valueChanges$ = this . ngControl . valueChanges . subscribe (
311
+ this . onValueChanged . bind ( this )
312
+ ) ;
308
313
}
309
314
310
315
this . cdr . detectChanges ( ) ;
@@ -314,6 +319,10 @@ export class IgxInputDirective implements AfterViewInit, OnDestroy {
314
319
if ( this . _statusChanges$ ) {
315
320
this . _statusChanges$ . unsubscribe ( ) ;
316
321
}
322
+
323
+ if ( this . _valueChanges$ ) {
324
+ this . _valueChanges$ . unsubscribe ( ) ;
325
+ }
317
326
}
318
327
/**
319
328
* Sets a focus on the igxInput.
@@ -345,6 +354,14 @@ export class IgxInputDirective implements AfterViewInit, OnDestroy {
345
354
}
346
355
this . updateValidityState ( ) ;
347
356
}
357
+
358
+ /** @hidden @internal */
359
+ protected onValueChanged ( ) {
360
+ if ( this . _fileNames && ! this . value ) {
361
+ this . _fileNames = '' ;
362
+ }
363
+ }
364
+
348
365
/**
349
366
* @hidden
350
367
* @internal
0 commit comments