Passthrough input ref

This commit is contained in:
Pavel Djundik 2018-07-09 21:53:49 +03:00 committed by Pavel Djundik
parent 2e3b95b9ed
commit f9d255b678
2 changed files with 3 additions and 3 deletions

View File

@ -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);

View File

@ -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;