Skip to content

Commit

Permalink
fix(typeahead): Hide typeahead popup on blur. Fixes #351
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Sluiter committed Mar 30, 2016
1 parent 18456f4 commit 9c6f257
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions components/typeahead/typeahead.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,11 @@ export class Typeahead implements OnInit {
}
}

@HostListener('blur', ['$event.target'])
onblur() {
this.hide();
}

public changeModel(value:any) {
let valueStr:string = ((typeof value === 'object' && this.typeaheadOptionField) ? value[this.typeaheadOptionField] : value).toString();
this.cd.viewToModelUpdate(valueStr);
Expand Down

0 comments on commit 9c6f257

Please sign in to comment.