@@ -111,6 +111,9 @@ export class MdChipList implements MdFormFieldControl<any>, ControlValueAccessor
111
111
/** Subscription to focus changes in the chips. */
112
112
private _chipFocusSubscription : Subscription | null ;
113
113
114
+ /** Subscription to blur changes in the chips. */
115
+ private _chipBlurSubscription : Subscription | null ;
116
+
114
117
/** Subscription to selection changes in chips. */
115
118
private _chipSelectionSubscription : Subscription | null ;
116
119
@@ -284,6 +287,11 @@ export class MdChipList implements MdFormFieldControl<any>, ControlValueAccessor
284
287
return merge ( ...this . chips . map ( chip => chip . _onFocus ) ) ;
285
288
}
286
289
290
+ /** Combined stream of all of the child chips' blur change events. */
291
+ get chipBlurChanges ( ) : Observable < MdChipEvent > {
292
+ return merge ( ...this . chips . map ( chip => chip . _onBlur ) ) ;
293
+ }
294
+
287
295
/** Combined stream of all of the child chips' remove change events. */
288
296
get chipRemoveChanges ( ) : Observable < MdChipEvent > {
289
297
return merge ( ...this . chips . map ( chip => chip . destroy ) ) ;
@@ -656,6 +664,11 @@ export class MdChipList implements MdFormFieldControl<any>, ControlValueAccessor
656
664
this . _chipFocusSubscription = null ;
657
665
}
658
666
667
+ if ( this . _chipBlurSubscription ) {
668
+ this . _chipBlurSubscription . unsubscribe ( ) ;
669
+ this . _chipBlurSubscription = null ;
670
+ }
671
+
659
672
if ( this . _chipSelectionSubscription ) {
660
673
this . _chipSelectionSubscription . unsubscribe ( ) ;
661
674
this . _chipSelectionSubscription = null ;
@@ -694,6 +707,11 @@ export class MdChipList implements MdFormFieldControl<any>, ControlValueAccessor
694
707
}
695
708
this . stateChanges . next ( ) ;
696
709
} ) ;
710
+
711
+ this . _chipBlurSubscription = this . chipBlurChanges . subscribe ( _ => {
712
+ this . _blur ( ) ;
713
+ this . stateChanges . next ( ) ;
714
+ } ) ;
697
715
}
698
716
699
717
private _listenToChipsRemoved ( ) : void {
0 commit comments