This repository has been archived by the owner on May 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(typeahead): keep pop-up on clicking input
Also, keep reference to event listener to unbind when scope is destroyed. (Memory leak)
- Loading branch information
1 parent
45dd9be
commit 5f9e270
Showing
2 changed files
with
29 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -378,6 +378,23 @@ describe('typeahead tests', function () { | |
expect($scope.email).toEqual('[email protected]'); | ||
expect(inputEl.val()).toEqual('[email protected]'); | ||
}); | ||
|
||
it('does not close matches popup on click in input', function () { | ||
var element = prepareInputEl("<div><input ng-model='result' typeahead='item for item in source | filter:$viewValue'></div>"); | ||
var inputEl = findInput(element); | ||
|
||
// Note that this bug can only be found when element is in the document | ||
$document.find('body').append(element); | ||
// Extra teardown for this spec | ||
this.after(function () { element.remove(); }); | ||
|
||
changeInputValueTo(element, 'b'); | ||
|
||
inputEl.click(); | ||
$scope.$digest(); | ||
|
||
expect(element).toBeOpenWithActive(2, 0); | ||
}); | ||
}); | ||
|
||
describe('input formatting', function () { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters