Skip to content

Commit

Permalink
Fixing autoselect based on comments @ angular-ui#908 (comment)
Browse files Browse the repository at this point in the history
Fixing autoselect based on comments @ angular-ui#908 (comment)
  • Loading branch information
janunezc committed Jul 24, 2014
1 parent 7512b93 commit a39f814
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/typeahead/typeahead.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap
isLoadingSetter(originalScope, true);
$q.when(parserResult.source(originalScope, locals)).then(function(matches) {

//Q&E FIX FOR AUTOSELECT based on https://github.com/angular-ui/bootstrap/issues/908#issuecomment-41289477
matches.unshift(inputValue);
//END OF: Q&E FIX FOR AUTOSELECT

//it might happen that several async queries were in progress if a user were typing fast
//but we are interested only in responses that correspond to the current view value
var onCurrentRequest = (inputValue === modelCtrl.$viewValue);
Expand Down

0 comments on commit a39f814

Please sign in to comment.