Passthrough input ref
This commit is contained in:
parent
2e3b95b9ed
commit
f9d255b678
@ -67,7 +67,7 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
if (this.$root.settings.autocomplete) {
|
if (this.$root.settings.autocomplete) {
|
||||||
require("../js/autocompletion").enable();
|
require("../js/autocompletion").enable(this.$refs.input);
|
||||||
}
|
}
|
||||||
|
|
||||||
const inputTrap = Mousetrap(this.$refs.input);
|
const inputTrap = Mousetrap(this.$refs.input);
|
||||||
|
@ -172,12 +172,12 @@ const backgroundColorStrategy = {
|
|||||||
index: 2,
|
index: 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
function enableAutocomplete() {
|
function enableAutocomplete(inputRef) {
|
||||||
enabled = true;
|
enabled = true;
|
||||||
let tabCount = 0;
|
let tabCount = 0;
|
||||||
let lastMatch = "";
|
let lastMatch = "";
|
||||||
let currentMatches = [];
|
let currentMatches = [];
|
||||||
input = $("#input");
|
input = $(inputRef);
|
||||||
|
|
||||||
input.on("input.tabcomplete", () => {
|
input.on("input.tabcomplete", () => {
|
||||||
tabCount = 0;
|
tabCount = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user