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
=== modified file 'src/Ubuntu/Components/1.3/InputHandler.qml'
--- src/Ubuntu/Components/1.3/InputHandler.qml 2016-04-25 10:45:41 +0000
+++ src/Ubuntu/Components/1.3/InputHandler.qml 2016-05-11 11:01:30 +0000
@@ -292,9 +292,7 @@
292 target: main292 target: main
293 ignoreUnknownSignals: true293 ignoreUnknownSignals: true
294 onActiveFocusChanged: {294 onActiveFocusChanged: {
295 if (!main.activeFocus) {295 input.focus = main.activeFocus;
296 input.focus = false;
297 }
298 }296 }
299 onKeyNavigationFocusChanged: {297 onKeyNavigationFocusChanged: {
300 if (main.keyNavigationFocus) {298 if (main.keyNavigationFocus) {
301299
=== modified file 'tests/unit_x11/tst_components/tst_textinput_common13.qml'
--- tests/unit_x11/tst_components/tst_textinput_common13.qml 2016-04-08 07:40:38 +0000
+++ tests/unit_x11/tst_components/tst_textinput_common13.qml 2016-05-11 11:01:30 +0000
@@ -23,7 +23,7 @@
23Item {23Item {
24 id: testMain24 id: testMain
25 width: units.gu(40)25 width: units.gu(40)
26 height: units.gu(50)26 height: units.gu(70)
2727
28 Component {28 Component {
29 id: popoverComponent29 id: popoverComponent
@@ -97,6 +97,33 @@
97 id: textField97 id: textField
98 }98 }
9999
100 FocusScope {
101 id: scope
102 width: textFieldInMouseArea.implicitWidth
103 height: textFieldInMouseArea.implicitHeight
104 TextField {
105 anchors.fill: parent
106 id: textFieldInMouseArea
107 text: 'Lorem ipsum dolor sit amet'
108 color: UbuntuColors.blue
109 }
110 MouseArea {
111 anchors.fill: parent
112 enabled: !scope.activeFocus
113 onClicked: {
114 textFieldInMouseArea.forceActiveFocus()
115 textFieldInMouseArea.selectAll()
116 }
117 UbuntuShape {
118 anchors.fill: parent
119 aspect: UbuntuShape.Flat
120 backgroundColor: UbuntuColors.blue
121 opacity: 0.1
122 visible: parent.enabled
123 }
124 }
125 }
126
100 TextField {127 TextField {
101 id: customTextField128 id: customTextField
102 text: 'Lorem ipsum dolor sit amet'129 text: 'Lorem ipsum dolor sit amet'
@@ -198,6 +225,11 @@
198 cursorRectSpy.clear();225 cursorRectSpy.clear();
199 scrollerSpy.clear();226 scrollerSpy.clear();
200 escapePressedSpy.clear();227 escapePressedSpy.clear();
228 // Hide OSK if showing
229 UbuntuApplication.inputMethod.visible = false;
230 // Dismiss popover if any
231 mouseClick(testMain, testMain.width - units.gu(1), testMain.height - units.gu(1));
232 waitForRendering(testMain);
201 }233 }
202234
203 function test_context_menu_items_data() {235 function test_context_menu_items_data() {
@@ -543,5 +575,24 @@
543 keyClick(Qt.Key_Escape);575 keyClick(Qt.Key_Escape);
544 compare(escapePressedSpy.count, 1);576 compare(escapePressedSpy.count, 1);
545 }577 }
578
579 function test_text_field_evokes_osk_bug1545802_data() {
580 return [
581 { tag: 'textField', input: textField },
582 { tag: 'textField with icons', input: customTextField },
583 { tag: 'textArea', input: textArea },
584 { tag: 'focusScope', input: textFieldInMouseArea },
585 ];
586 }
587 function test_text_field_evokes_osk_bug1545802(data) {
588 // FIXME: Figure out the CI failures and unskip, bug #1580538
589 skip("This test fails on amd64-stable and i386-gles on CI and passes locally on amd64-devel.");
590 waitForRendering(data.input);
591 compare(data.input.activeFocus, false, 'TextField is not yet focused');
592 mouseClick(data.input);
593 waitForRendering(data.input);
594 compare(data.input.activeFocus, true, 'TextField is focused');
595 compare(UbuntuApplication.inputMethod.visible, true, 'OSK is visible');
596 }
546 }597 }
547}598}

Subscribers

People subscribed via source and target branches

to status/vote changes: