diff --git a/src/typeahead/test/typeahead.spec.js b/src/typeahead/test/typeahead.spec.js index 8f1bd3fdf7..89c893dea8 100644 --- a/src/typeahead/test/typeahead.spec.js +++ b/src/typeahead/test/typeahead.spec.js @@ -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 () { @@ -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 () { @@ -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 () { diff --git a/src/typeahead/typeahead.js b/src/typeahead/typeahead.js index b4541def17..8a128fce14 100644 --- a/src/typeahead/typeahead.js +++ b/src/typeahead/typeahead.js @@ -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(); };