Skip to content
This repository has been archived by the owner on Nov 22, 2021. It is now read-only.

Commit

Permalink
fix(autocomplete): Hide the suggestion list after a tag is removed
Browse files Browse the repository at this point in the history
Hide the autocomplete list after a tag is removed because keeping it
open is confusing to the user since it doesn't contain the tag which
was just deleted.
  • Loading branch information
mbenford committed Jul 12, 2015
1 parent f923468 commit 731ef9e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/auto-complete.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ tagsInput.directive('autoComplete', function($document, $timeout, $sce, $q, tags
};

tagsInput
.on('tag-added invalid-tag input-blur', function() {
.on('tag-added tag-removed invalid-tag input-blur', function() {
suggestionList.reset();
})
.on('input-change', function(value) {
Expand Down
4 changes: 2 additions & 2 deletions test/auto-complete.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ describe('autoComplete directive', function() {
expect(isSuggestionsBoxVisible()).toBe(false);
});

it('doesn\'t hide the suggestion box when a tag is removed', function() {
it('hides the suggestion box when a tag is removed', function() {
// Arrange
suggestionList.show();
$scope.$digest();
Expand All @@ -282,7 +282,7 @@ describe('autoComplete directive', function() {
$scope.$digest();

// Assert
expect(isSuggestionsBoxVisible()).toBe(true);
expect(isSuggestionsBoxVisible()).toBe(false);
});

it('hides the suggestion box after adding the selected suggestion to the input field', function() {
Expand Down

0 comments on commit 731ef9e

Please sign in to comment.