Skip to content

Commit

Permalink
TermInput: Handle Enter just like a normal exchange
Browse files Browse the repository at this point in the history
  • Loading branch information
nilmerg committed Apr 27, 2023
1 parent 803c73d commit dd2b3ca
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions asset/js/widget/TermInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,22 @@ define(["BaseInput"], function (BaseInput) {
}
}
}

onButtonClick(event) {
if (! this.hasSyntaxError()) {
let addedTerms = this.exchangeTerm();
if (Object.keys(addedTerms).length) {
this.togglePlaceholder();
event.preventDefault();
this.autoSubmit(this.input, 'exchange', addedTerms);
this.ignoreSpaceUntil = null;

return;
}
}

super.onButtonClick(event);
}
}

return TermInput;
Expand Down

0 comments on commit dd2b3ca

Please sign in to comment.