Fix reverse tabbing not working in autocompletion

Now call autocomplete() also for shift+tab

Fix #377

(cherry picked from commit 3329739d55)
This commit is contained in:
Carl Schwan
2021-05-28 14:56:36 +02:00
parent 76bd529c3c
commit 5a28a93ab6

View File

@@ -165,12 +165,18 @@ ToolBar {
nextItemInFocusChain(false).forceActiveFocus(Qt.TabFocusReason)
return
}
let decrementedIndex = completionMenu.currentIndex - 1
// Wrap around to the last item
if (decrementedIndex < 0) {
decrementedIndex = Math.max(completionMenu.count - 1, 0) // 0 if count == 0
if (!autoAppeared) {
let decrementedIndex = completionMenu.currentIndex - 1
// Wrap around to the last item
if (decrementedIndex < 0) {
decrementedIndex = Math.max(completionMenu.count - 1, 0) // 0 if count == 0
}
completionMenu.currentIndex = decrementedIndex
} else {
autoAppeared = false;
}
completionMenu.currentIndex = decrementedIndex
chatBar.complete();
}
Keys.onTabPressed: {
@@ -187,7 +193,7 @@ ToolBar {
// ignore first time tab was clicked so that user can select
// first emoji/user
if (autoAppeared === false) {
if (!autoAppeared) {
let incrementedIndex = completionMenu.currentIndex + 1;
// Wrap around to the first item
if (incrementedIndex > completionMenu.count - 1) {