Fix autocompletion menu not closing on send

This commit is contained in:
Pavel Djundik 2018-07-31 17:39:03 +03:00 committed by Pavel Djundik
parent 6877199515
commit 1d4ab8fff1

View File

@ -16,6 +16,7 @@ module.exports = {
enable: enableAutocomplete,
disable() {
if (enabled) {
$("#form").off("submit.tabcomplete");
input.off("input.tabcomplete");
Mousetrap(input.get(0)).unbind("tab", "keydown");
textcomplete.destroy();
@ -24,12 +25,6 @@ module.exports = {
},
};
$("#form").on("submit", () => {
if (enabled) {
textcomplete.hide();
}
});
const emojiSearchTerms = Object.keys(emojiMap);
const emojiStrategy = {
id: "emoji",
@ -263,6 +258,10 @@ function enableAutocomplete(inputRef) {
textcomplete.on("hidden", () => {
autocompleting = false;
});
$("#form").on("submit.tabcomplete", () => {
textcomplete.hide();
});
}
function fuzzyGrep(term, array) {