Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Commit

Permalink
fix(typeahead): correctly close popup on match selection
Browse files Browse the repository at this point in the history
  • Loading branch information
pkozlowski-opensource committed Jul 6, 2013
1 parent 4da17a4 commit 624fd5f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/typeahead/test/typeahead.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ describe('typeahead tests', function () {

expect($scope.result).toEqual('bar');
expect(inputEl.val()).toEqual('bar');
expect(element).toBeClosed();
});

it('should select a match on tab', function () {
Expand All @@ -244,6 +245,7 @@ describe('typeahead tests', function () {

expect($scope.result).toEqual('bar');
expect(inputEl.val()).toEqual('bar');
expect(element).toBeClosed();
});

it('should select match on click', function () {
Expand All @@ -259,6 +261,7 @@ describe('typeahead tests', function () {

expect($scope.result).toEqual('baz');
expect(inputEl.val()).toEqual('baz');
expect(element).toBeClosed();
});

it('should invoke select callback on select', function () {
Expand Down
1 change: 1 addition & 0 deletions src/typeahead/typeahead.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position'])
});

//return focus to the input element if a mach was selected via a mouse click event
resetMatches();
element[0].focus();
};

Expand Down

0 comments on commit 624fd5f

Please sign in to comment.