diff --git a/js/autocomplete.js b/js/autocomplete.js
index 2115053a7b..6def31da23 100644
--- a/js/autocomplete.js
+++ b/js/autocomplete.js
@@ -233,6 +233,9 @@
// jQuery.toggle() expects a boolean parameter
$ul.toggle(!!$ul.children().length);
});
+
+ // Remove relatedResourceForm from stack
+ relatedResourceForms.remove($input.data('relatedResourceForm'));
});
$li.appendTo($ul);
@@ -304,7 +307,7 @@
// Make autocomplete , copy @class from , copy @id from
// so is correct, and copy aria-describedby and disabled attribute.
var $input = $('');
-
+
if ($select.attr('aria-describedby')) {
$input.attr('aria-describedby', $select.attr('aria-describedby'))
}
@@ -312,7 +315,7 @@
if ($select.attr('disabled')) {
$input.attr('disabled', $select.attr('disabled'))
}
-
+
$input.insertAfter(this);
if ($(this).attr('multiple')) {