From c502a07d2db51063feaf7210ba5b09d61ff5b027 Mon Sep 17 00:00:00 2001 From: Jarkko Koivikko Date: Thu, 17 Jun 2021 14:07:38 +0300 Subject: plugins/openwnn: Set word candidate index when item is selected When an item is selected from the word candidate list, the activeWordIndex variable was not updated to match the selected index, resulting in a missed list update. Fixes: QTBUG-94560 Pick-to: 5.15 6.1 6.2 Change-Id: I5757081a1269439fe39d5b5e93dd6f43382cce15 Reviewed-by: Mitch Curtis --- tests/auto/inputpanel/data/tst_inputpanel.qml | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests') 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. -- cgit v1.2.3