Skip to content

Commit

Permalink
TermInput.js : Fix unwanted space in input field
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sukhwinder33445 committed May 4, 2022
1 parent f4080ec commit a5fc0e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion asset/js/widget/TermInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a5fc0e2

Please sign in to comment.