diff --git a/client/components/ChatInput.vue b/client/components/ChatInput.vue index fc44db31..9129b644 100644 --- a/client/components/ChatInput.vue +++ b/client/components/ChatInput.vue @@ -67,7 +67,7 @@ export default { }, mounted() { if (this.$root.settings.autocomplete) { - require("../js/autocompletion").enable(); + require("../js/autocompletion").enable(this.$refs.input); } const inputTrap = Mousetrap(this.$refs.input); diff --git a/client/js/autocompletion.js b/client/js/autocompletion.js index 5a28c4f6..a426d8ab 100644 --- a/client/js/autocompletion.js +++ b/client/js/autocompletion.js @@ -172,12 +172,12 @@ const backgroundColorStrategy = { index: 2, }; -function enableAutocomplete() { +function enableAutocomplete(inputRef) { enabled = true; let tabCount = 0; let lastMatch = ""; let currentMatches = []; - input = $("#input"); + input = $(inputRef); input.on("input.tabcomplete", () => { tabCount = 0;