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 19, 2023
1 parent b8085a9 commit a9ee49e
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 @@ -161,6 +161,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 a9ee49e

Please sign in to comment.