Merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/inputMainFocusTrunks into lp:ubuntu-ui-toolkit

Proposed by Cris Dywan
Status: Merged
Approved by: Zoltan Balogh
Approved revision: 1316
Merged at revision: 1315
Proposed branch: lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/inputMainFocusTrunks
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 98 lines (+53/-4)
2 files modified
src/Ubuntu/Components/1.3/InputHandler.qml (+1/-3)
tests/unit_x11/tst_components/tst_textinput_common13.qml (+52/-1)
To merge this branch: bzr merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/inputMainFocusTrunks
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu SDK team Pending
Review via email: mp+294353@code.launchpad.net

Commit message

Text input focus must always follow main component

New tests assert that the OSK is shown.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Ubuntu/Components/1.3/InputHandler.qml'
2--- src/Ubuntu/Components/1.3/InputHandler.qml 2016-04-25 10:45:41 +0000
3+++ src/Ubuntu/Components/1.3/InputHandler.qml 2016-05-11 11:01:30 +0000
4@@ -292,9 +292,7 @@
5 target: main
6 ignoreUnknownSignals: true
7 onActiveFocusChanged: {
8- if (!main.activeFocus) {
9- input.focus = false;
10- }
11+ input.focus = main.activeFocus;
12 }
13 onKeyNavigationFocusChanged: {
14 if (main.keyNavigationFocus) {
15
16=== modified file 'tests/unit_x11/tst_components/tst_textinput_common13.qml'
17--- tests/unit_x11/tst_components/tst_textinput_common13.qml 2016-04-08 07:40:38 +0000
18+++ tests/unit_x11/tst_components/tst_textinput_common13.qml 2016-05-11 11:01:30 +0000
19@@ -23,7 +23,7 @@
20 Item {
21 id: testMain
22 width: units.gu(40)
23- height: units.gu(50)
24+ height: units.gu(70)
25
26 Component {
27 id: popoverComponent
28@@ -97,6 +97,33 @@
29 id: textField
30 }
31
32+ FocusScope {
33+ id: scope
34+ width: textFieldInMouseArea.implicitWidth
35+ height: textFieldInMouseArea.implicitHeight
36+ TextField {
37+ anchors.fill: parent
38+ id: textFieldInMouseArea
39+ text: 'Lorem ipsum dolor sit amet'
40+ color: UbuntuColors.blue
41+ }
42+ MouseArea {
43+ anchors.fill: parent
44+ enabled: !scope.activeFocus
45+ onClicked: {
46+ textFieldInMouseArea.forceActiveFocus()
47+ textFieldInMouseArea.selectAll()
48+ }
49+ UbuntuShape {
50+ anchors.fill: parent
51+ aspect: UbuntuShape.Flat
52+ backgroundColor: UbuntuColors.blue
53+ opacity: 0.1
54+ visible: parent.enabled
55+ }
56+ }
57+ }
58+
59 TextField {
60 id: customTextField
61 text: 'Lorem ipsum dolor sit amet'
62@@ -198,6 +225,11 @@
63 cursorRectSpy.clear();
64 scrollerSpy.clear();
65 escapePressedSpy.clear();
66+ // Hide OSK if showing
67+ UbuntuApplication.inputMethod.visible = false;
68+ // Dismiss popover if any
69+ mouseClick(testMain, testMain.width - units.gu(1), testMain.height - units.gu(1));
70+ waitForRendering(testMain);
71 }
72
73 function test_context_menu_items_data() {
74@@ -543,5 +575,24 @@
75 keyClick(Qt.Key_Escape);
76 compare(escapePressedSpy.count, 1);
77 }
78+
79+ function test_text_field_evokes_osk_bug1545802_data() {
80+ return [
81+ { tag: 'textField', input: textField },
82+ { tag: 'textField with icons', input: customTextField },
83+ { tag: 'textArea', input: textArea },
84+ { tag: 'focusScope', input: textFieldInMouseArea },
85+ ];
86+ }
87+ function test_text_field_evokes_osk_bug1545802(data) {
88+ // FIXME: Figure out the CI failures and unskip, bug #1580538
89+ skip("This test fails on amd64-stable and i386-gles on CI and passes locally on amd64-devel.");
90+ waitForRendering(data.input);
91+ compare(data.input.activeFocus, false, 'TextField is not yet focused');
92+ mouseClick(data.input);
93+ waitForRendering(data.input);
94+ compare(data.input.activeFocus, true, 'TextField is focused');
95+ compare(UbuntuApplication.inputMethod.visible, true, 'OSK is visible');
96+ }
97 }
98 }

Subscribers

People subscribed via source and target branches

to status/vote changes: