From ea69049e21f5d5bc67663cc2d18fe600fe00707e Mon Sep 17 00:00:00 2001 From: KoloMl Date: Sat, 14 Dec 2024 23:47:35 +0400 Subject: [PATCH] Fixed lint issue about overwriting the argument --- assets/js/autocomplete.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/assets/js/autocomplete.ts b/assets/js/autocomplete.ts index 12a19e55..f027e0d2 100644 --- a/assets/js/autocomplete.ts +++ b/assets/js/autocomplete.ts @@ -44,11 +44,13 @@ function applySelectedValue(selection: string) { if (!inputField) return; if (!isSearchField(inputField)) { + let resultValue = selection; + if (originalTerm?.startsWith('-')) { - selection = `-${selection}`; + resultValue = `-${selection}`; } - inputField.value = selection; + inputField.value = resultValue; return; }