Browse Source

Revert "Fix autocomplete chip X "ends with" conflicts"

This reverts commit 83ce08248d.
merge-requests/102/head
Deimos 5 years ago
parent
commit
6e610be349
  1. 2
      tildes/static/js/behaviors/autocomplete-chip-clear.js

2
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 $tagsHiddenInput = $("[data-js-autocomplete-hidden-input]");
var $autocompleteInput = $("[data-js-autocomplete-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, "")); $tagsHiddenInput.val($tagsHiddenInput.val().replace(textToReplace, ""));
$chip.remove(); $chip.remove();
$autocompleteInput.focus(); $autocompleteInput.focus();

Loading…
Cancel
Save