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

Commit 624fd5f

Browse files
committedJul 6, 2013
fix(typeahead): correctly close popup on match selection
1 parent 4da17a4 commit 624fd5f

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed
 

‎src/typeahead/test/typeahead.spec.js

+3
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ describe('typeahead tests', function () {
232232

233233
expect($scope.result).toEqual('bar');
234234
expect(inputEl.val()).toEqual('bar');
235+
expect(element).toBeClosed();
235236
});
236237

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

245246
expect($scope.result).toEqual('bar');
246247
expect(inputEl.val()).toEqual('bar');
248+
expect(element).toBeClosed();
247249
});
248250

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

260262
expect($scope.result).toEqual('baz');
261263
expect(inputEl.val()).toEqual('baz');
264+
expect(element).toBeClosed();
262265
});
263266

264267
it('should invoke select callback on select', function () {

‎src/typeahead/typeahead.js

+1
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position'])
195195
});
196196

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

0 commit comments

Comments
 (0)