From e471ffd07b4541f9c7c3c7168e098bf61e5bd5d7 Mon Sep 17 00:00:00 2001 From: Michael Campagnaro Date: Sun, 21 Jul 2013 22:37:01 -0400 Subject: [PATCH] Fix for autocomplete delete action removing only the last item --- app/assets/javascripts/discourse/components/autocomplete.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/components/autocomplete.js b/app/assets/javascripts/discourse/components/autocomplete.js index b46aff2fa6c..6e282f36a19 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();