diff --git a/src/auto-complete.js b/src/auto-complete.js index d559accc..58679ec5 100644 --- a/src/auto-complete.js +++ b/src/auto-complete.js @@ -136,9 +136,6 @@ angular.module('tags-input').directive('autoComplete', function($document, $time }; tagsInput - .on('tag-added', function() { - suggestionList.reset(); - }) .on('input-changed', function(value) { if (value) { suggestionList.load(value); diff --git a/src/tags-input.js b/src/tags-input.js index 33342810..7a707615 100644 --- a/src/tags-input.js +++ b/src/tags-input.js @@ -115,6 +115,7 @@ angular.module('tags-input').directive('tagsInput', function(configuration) { } $scope.newTag = ''; + events.trigger('input-changed', ''); changed = true; } return changed; diff --git a/test/auto-complete.spec.js b/test/auto-complete.spec.js index 84df66c3..ee6e07a9 100644 --- a/test/auto-complete.spec.js +++ b/test/auto-complete.spec.js @@ -174,17 +174,6 @@ describe('autocomplete-directive', function() { expect(isSuggestionsBoxVisible()).toBe(false); }); - it('hides the suggestion box when a tag is added', function() { - // Arrange - suggestionList.show(); - - // Act - eventHandlers['tag-added'](); - - // Assert - expect(isSuggestionsBoxVisible()).toBe(false); - }); - it('adds the selected suggestion to the input field when the enter key is pressed and the suggestions box is visible', function() { // Arrange loadSuggestions(['Item1', 'Item2']);