From 6e610be3495e7865b366e4bd10328097057c908d Mon Sep 17 00:00:00 2001 From: Deimos Date: Thu, 5 Mar 2020 01:03:50 -0700 Subject: [PATCH] Revert "Fix autocomplete chip X "ends with" conflicts" This reverts commit 83ce08248d3b4ff22dd7c996846d3a9537673a85. --- tildes/static/js/behaviors/autocomplete-chip-clear.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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();