Restore - prefix when sending autocomplete from mouse clicks

This commit is contained in:
KoloMl 2024-12-14 23:48:16 +04:00
parent ea69049e21
commit 5c8ae5f54b

View file

@ -232,8 +232,12 @@ function listenAutocomplete() {
const originalSuggestion = event.detail; const originalSuggestion = event.detail;
applySelectedValue(originalSuggestion.value); applySelectedValue(originalSuggestion.value);
if (originalTerm?.startsWith('-')) {
originalSuggestion.value = `-${originalSuggestion.value}`;
}
inputField.dispatchEvent( inputField.dispatchEvent(
new CustomEvent('autocomplete', { new CustomEvent<TermSuggestion>('autocomplete', {
detail: Object.assign( detail: Object.assign(
{ {
type: 'click', type: 'click',