From 48c0fc2937ea3bd2cf3736781b798e1582075531 Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Mon, 7 Mar 2022 14:45:01 +0100 Subject: [PATCH] TermInput.js : Fix unwanted space in input field After adding a term by pressing the spacebar, an unwanted space was inserted into the input field. This happens because the if condition was always false, since we cannot read the length from the object with the .length property. --- asset/js/widget/TermInput.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asset/js/widget/TermInput.js b/asset/js/widget/TermInput.js index 2e778e8c..18c2cd78 100644 --- a/asset/js/widget/TermInput.js +++ b/asset/js/widget/TermInput.js @@ -88,7 +88,7 @@ define(["BaseInput"], function (BaseInput) { } let addedTerms = this.exchangeTerm(); - if (addedTerms.length) { + if (Object.keys(addedTerms).length) { this.togglePlaceholder(); event.preventDefault(); this.autoSubmit(this.input, 'exchange', addedTerms);