diff --git a/tildes/static/js/behaviors/autocomplete-chip-clear.js b/tildes/static/js/behaviors/autocomplete-chip-clear.js index 1c013e6..7f3b784 100644 --- a/tildes/static/js/behaviors/autocomplete-chip-clear.js +++ b/tildes/static/js/behaviors/autocomplete-chip-clear.js @@ -6,7 +6,7 @@ $.onmount("[data-js-autocomplete-chip-clear]", function() { var $tagsHiddenInput = $("[data-js-autocomplete-hidden-input]"); var $autocompleteInput = $("[data-js-autocomplete-input]"); - var textToReplace = new RegExp("(^|,)" + $chip.text() + ","); + var textToReplace = new RegExp($chip.text() + ","); $tagsHiddenInput.val($tagsHiddenInput.val().replace(textToReplace, "")); $chip.remove(); $autocompleteInput.focus();