on xenial help sign in
fix the focus moving correctly between launcher and drawer (LP: #1669880)
7645501Michael Zanetti
qml/Launcher/Launcher.qml+1
@@ -163,6 +163,7 @@ FocusScope {
163
163
164 function openForKeyboardNavigation() {
164 function openForKeyboardNavigation() {
165 panel.highlightIndex = -1; // The BFB
165 panel.highlightIndex = -1; // The BFB
166+ drawer.focus = false;
166 root.focus = true;
167 root.focus = true;
167 switchToNextState("visible")
168 switchToNextState("visible")
168 }
169 }
tests/qmltests/Launcher/tst_Drawer.qml+21
@@ -329,6 +329,27 @@ StyledItem {
329 tryCompare(launcher, "state", "visibleTemporary");
329 tryCompare(launcher, "state", "visibleTemporary");
330 }
330 }
331
331
332+ function test_focusMovesCorrectlyBetweenLauncherAndDrawer() {
333+ var panel = findChild(launcher, "launcherPanel");
334+ var drawer = findChild(launcher, "drawer");
335+ var searchField = findChild(drawer, "searchField");
336+
337+ launcher.openForKeyboardNavigation();
338+ tryCompare(panel, "highlightIndex", -1);
339+ keyClick(Qt.Key_Down);
340+ tryCompare(panel, "highlightIndex", 0);
341+
342+ launcher.openDrawer(true);
343+ tryCompare(searchField, "focus", true);
344+
345+ keyClick(Qt.Key_Escape);
346+
347+ launcher.openForKeyboardNavigation();
348+ tryCompare(panel, "highlightIndex", -1);
349+ keyClick(Qt.Key_Down);
350+ tryCompare(panel, "highlightIndex", 0);
351+ }
352+
332 function test_closeWhileDragging() {
353 function test_closeWhileDragging() {
333 launcher.openDrawer(true);
354 launcher.openDrawer(true);
334 waitForRendering(launcher);
355 waitForRendering(launcher);