diff --git a/assets/js/autocomplete.ts b/assets/js/autocomplete.ts index f027e0d2..c26140c0 100644 --- a/assets/js/autocomplete.ts +++ b/assets/js/autocomplete.ts @@ -232,8 +232,12 @@ function listenAutocomplete() { const originalSuggestion = event.detail; applySelectedValue(originalSuggestion.value); + if (originalTerm?.startsWith('-')) { + originalSuggestion.value = `-${originalSuggestion.value}`; + } + inputField.dispatchEvent( - new CustomEvent('autocomplete', { + new CustomEvent('autocomplete', { detail: Object.assign( { type: 'click',