Do not navigate history when autocompleting
This commit is contained in:
parent
4c103b467b
commit
f526aa8b8b
@ -116,7 +116,7 @@ export default {
|
||||
});
|
||||
|
||||
inputTrap.bind(["up", "down"], (e, key) => {
|
||||
if (e.target.selectionStart !== e.target.selectionEnd) {
|
||||
if (this.$root.isAutoCompleting || e.target.selectionStart !== e.target.selectionEnd) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,7 @@ module.exports = {
|
||||
Mousetrap(input.get(0)).unbind("tab", "keydown");
|
||||
textcomplete.destroy();
|
||||
enabled = false;
|
||||
vueApp.isAutoCompleting = false;
|
||||
}
|
||||
},
|
||||
};
|
||||
@ -169,7 +170,6 @@ const backgroundColorStrategy = {
|
||||
|
||||
function enableAutocomplete(inputRef) {
|
||||
enabled = true;
|
||||
let autocompleting = false;
|
||||
let tabCount = 0;
|
||||
let lastMatch = "";
|
||||
let currentMatches = [];
|
||||
@ -186,7 +186,7 @@ function enableAutocomplete(inputRef) {
|
||||
});
|
||||
|
||||
Mousetrap(input.get(0)).bind("tab", (e) => {
|
||||
if (autocompleting) {
|
||||
if (vueApp.isAutoCompleting) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -252,11 +252,11 @@ function enableAutocomplete(inputRef) {
|
||||
});
|
||||
|
||||
textcomplete.on("show", () => {
|
||||
autocompleting = true;
|
||||
vueApp.isAutoCompleting = true;
|
||||
});
|
||||
|
||||
textcomplete.on("hidden", () => {
|
||||
autocompleting = false;
|
||||
vueApp.isAutoCompleting = false;
|
||||
});
|
||||
|
||||
$("#form").on("submit.tabcomplete", () => {
|
||||
|
@ -26,6 +26,7 @@ const vueApp = new Vue({
|
||||
connectionError: false,
|
||||
fileUploadEnabled: false,
|
||||
isNotified: false,
|
||||
isAutoCompleting: false,
|
||||
appName: document.title,
|
||||
activeChannel: null,
|
||||
networks: [],
|
||||
|
Loading…
Reference in New Issue
Block a user