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 21, 2023
1 parent a86d529 commit 5816848
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 5816848

Please sign in to comment.