aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/openwnn/plugin/openwnninputmethod.cpp1
-rw-r--r--tests/auto/inputpanel/data/tst_inputpanel.qml13
2 files changed, 14 insertions, 0 deletions
diff --git a/src/plugins/openwnn/plugin/openwnninputmethod.cpp b/src/plugins/openwnn/plugin/openwnninputmethod.cpp
index 81e933fc..b3557cab 100644
--- a/src/plugins/openwnn/plugin/openwnninputmethod.cpp
+++ b/src/plugins/openwnn/plugin/openwnninputmethod.cpp
@@ -805,6 +805,7 @@ void OpenWnnInputMethod::selectionListItemSelected(QVirtualKeyboardSelectionList
{
Q_UNUSED(type);
Q_D(OpenWnnInputMethod);
+ d->activeWordIndex = index;
// Set selected text as preeditText to place cursor at the end of selected text
inputContext()->setPreeditText(d->candidateList.at(index)->candidate);
d->commitText(*d->candidateList.at(index));
diff --git a/tests/auto/inputpanel/data/tst_inputpanel.qml b/tests/auto/inputpanel/data/tst_inputpanel.qml
index 03ca7cbf..91394bea 100644
--- a/tests/auto/inputpanel/data/tst_inputpanel.qml
+++ b/tests/auto/inputpanel/data/tst_inputpanel.qml
@@ -1249,6 +1249,19 @@ Rectangle {
compare(textInput.cursorPosition, data.expectedCursorPosition)
}
+ function test_japaneseSelectCurrentItemResetsIndex() {
+ prepareTest({ initLocale: "ja_JP" }, true)
+
+ verify(inputPanel.virtualKeyClick("a"))
+ verify(inputPanel.virtualKeyClick("a"))
+ verify(inputPanel.virtualKeyClick("a"))
+
+ compare(inputPanel.wordCandidateView.currentIndex, -1)
+ inputPanel.wordCandidateView.currentIndex = 0
+ inputPanel.selectionListSelectCurrentItem()
+ compare(inputPanel.wordCandidateView.currentIndex, -1, "QTBUG-94560")
+ }
+
function test_baseKeyNoModifier() {
// The Japanese keyboard uses the BaseKey.noModifier flag for the arrow keys.
// Without this flag the arrow key + shift would extend the text selection.