Skip to content

Commit e3b2486

Browse files
crisbetommalerba
authored andcommitted
refactor(autocomplete): merge optionSelections into single observable (#3212)
Merges the `optionSelections` into a single observable, in order to make it easier to consume. Fixes #3205.
1 parent ceb472b commit e3b2486

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib/autocomplete/autocomplete-trigger.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,15 @@ export class MdAutocompleteTrigger implements AfterContentInit, ControlValueAcce
153153
*/
154154
get panelClosingActions(): Observable<MdOptionSelectEvent> {
155155
return Observable.merge(
156-
...this.optionSelections,
156+
this.optionSelections,
157157
this._blurStream.asObservable(),
158158
this._keyManager.tabOut
159159
);
160160
}
161161

162162
/** Stream of autocomplete option selections. */
163-
get optionSelections(): Observable<MdOptionSelectEvent>[] {
164-
return this.autocomplete.options.map(option => option.onSelect);
163+
get optionSelections(): Observable<MdOptionSelectEvent> {
164+
return Observable.merge(...this.autocomplete.options.map(option => option.onSelect));
165165
}
166166

167167
/** The currently active option, coerced to MdOption type. */

0 commit comments

Comments
 (0)