diff --git a/app/assets/javascripts/discourse/components/autocomplete.js b/app/assets/javascripts/discourse/components/autocomplete.js index b46aff2fa..6e282f36a 100644 --- a/app/assets/javascripts/discourse/components/autocomplete.js +++ b/app/assets/javascripts/discourse/components/autocomplete.js @@ -64,7 +64,7 @@ $.fn.autocomplete = function(options) { d.find('a').click(function() { closeAutocomplete(); - inputSelectedItems.splice($.inArray(item), 1); + inputSelectedItems.splice($.inArray(item, inputSelectedItems), 1); $(this).parent().parent().remove(); if (options.single) { me.show();