@@ -11,6 +11,7 @@ import 'rxjs/add/operator/toArray';
1111import 'rxjs/add/operator/filter' ;
1212import 'rxjs/add/operator/mergeAll' ;
1313import 'rxjs/add/operator/publishReplay' ;
14+ import 'rxjs/add/observable/of' ;
1415import { ControlValueAccessor , NG_VALUE_ACCESSOR } from '@angular/forms' ;
1516import { TypeaheadSettings , TypeaheadSuggestions } from './typeahead.interface' ;
1617
@@ -92,7 +93,8 @@ const sanitizeString = (text: string) =>
9293 (keyup)="handleInput($event)"
9394 (keydown)="handleInput($event)"
9495 (paste)="handleInput($event)"
95- (click)="toggleDropdown(true)"/>
96+ (click)="toggleDropdown(true)"
97+ (change)="handleInputChange($event)">
9698 <i *ngIf="!isDisabled" (click)="toggleDropdown()" tabindex="-1"
9799 [ngClass]="settings.dropdownToggleClass"></i>
98100 <div role="menu" [attr.class]="dropDownClass" *ngIf="matches.length || !custom">
@@ -329,6 +331,16 @@ export class TypeaheadComponent implements ControlValueAccessor, AfterViewInit,
329331 this . writeValue ( value ) ;
330332 }
331333
334+ /**
335+ * Handle input change event
336+ * @param {Event } event
337+ */
338+ handleInputChange ( event : Event ) {
339+ // Stop the propagation of event up the DOM tree in case
340+ // `change` event handler is attached to host component.
341+ event . stopPropagation ( ) ;
342+ }
343+
332344 /**
333345 * Update value on input change
334346 * @param event
0 commit comments