@@ -104,6 +104,9 @@ export class MdChipList implements MdFormFieldControl<any>, ControlValueAccessor
104
104
/** Subscription to focus changes in the chips. */
105
105
private _chipFocusSubscription : Subscription | null ;
106
106
107
+ /** Subscription to blur changes in the chips. */
108
+ private _chipBlurSubscription : Subscription | null ;
109
+
107
110
/** Subscription to selection changes in chips. */
108
111
private _chipSelectionSubscription : Subscription | null ;
109
112
@@ -277,6 +280,11 @@ export class MdChipList implements MdFormFieldControl<any>, ControlValueAccessor
277
280
return merge ( ...this . chips . map ( chip => chip . _onFocus ) ) ;
278
281
}
279
282
283
+ /** Combined stream of all of the child chips' blur change events. */
284
+ get chipBlurChanges ( ) : Observable < MdChipEvent > {
285
+ return merge ( ...this . chips . map ( chip => chip . _onBlur ) ) ;
286
+ }
287
+
280
288
/** Combined stream of all of the child chips' remove change events. */
281
289
get chipRemoveChanges ( ) : Observable < MdChipEvent > {
282
290
return merge ( ...this . chips . map ( chip => chip . destroy ) ) ;
@@ -649,6 +657,11 @@ export class MdChipList implements MdFormFieldControl<any>, ControlValueAccessor
649
657
this . _chipFocusSubscription = null ;
650
658
}
651
659
660
+ if ( this . _chipBlurSubscription ) {
661
+ this . _chipBlurSubscription . unsubscribe ( ) ;
662
+ this . _chipBlurSubscription = null ;
663
+ }
664
+
652
665
if ( this . _chipSelectionSubscription ) {
653
666
this . _chipSelectionSubscription . unsubscribe ( ) ;
654
667
this . _chipSelectionSubscription = null ;
@@ -687,6 +700,11 @@ export class MdChipList implements MdFormFieldControl<any>, ControlValueAccessor
687
700
}
688
701
this . stateChanges . next ( ) ;
689
702
} ) ;
703
+
704
+ this . _chipBlurSubscription = this . chipBlurChanges . subscribe ( _ => {
705
+ this . _blur ( ) ;
706
+ this . stateChanges . next ( ) ;
707
+ } ) ;
690
708
}
691
709
692
710
private _listenToChipsRemoved ( ) : void {
0 commit comments