Skip to content

Commit

Permalink
Merge pull request #352 from slintes/typeahead-hide-on-blur
Browse files Browse the repository at this point in the history
Hide typeahead popup on blur. Fixes #351
  • Loading branch information
valorkin committed Mar 30, 2016
2 parents 6d9103e + 9c6f257 commit df5c74e
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 df5c74e

Please sign in to comment.