From 41107bc99b15af5a5d25008b67b41a784db961c8 Mon Sep 17 00:00:00 2001 From: Black Hat Date: Tue, 23 Oct 2018 11:51:46 +0800 Subject: [PATCH] First working autocomplete. --- imports/Spectral/Panel/RoomPanelInput.qml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/imports/Spectral/Panel/RoomPanelInput.qml b/imports/Spectral/Panel/RoomPanelInput.qml index f4dac28..41bc6b3 100644 --- a/imports/Spectral/Panel/RoomPanelInput.qml +++ b/imports/Spectral/Panel/RoomPanelInput.qml @@ -41,7 +41,7 @@ Rectangle { id: userAutoComplete - visible: isAutoCompleting + visible: isAutoCompleting && autoCompleteModel.length !== 0 contentItem: ListView { id: userAutoCompleteListView @@ -213,7 +213,9 @@ Rectangle { repeatTimer.start() currentRoom.cachedInput = text - if (cursorPosition < autoCompleteBeginPosition || cursorPosition > autoCompleteEndPosition) isAutoCompleting = false + if (cursorPosition !== autoCompleteBeginPosition && cursorPosition !== autoCompleteEndPosition) { + isAutoCompleting = false + } } function postMessage(text) {