on xenial help sign in
fix focus issue in launcher and drawer
cc805e7Michael Zanetti
qml/Launcher/Launcher.qml+1
@@ -152,6 +152,7 @@ FocusScope {
152
152
153 function openForKeyboardNavigation() {
153 function openForKeyboardNavigation() {
154 panel.highlightIndex = -1; // The BFB
154 panel.highlightIndex = -1; // The BFB
155+ drawer.focus = false;
155 root.focus = true;
156 root.focus = true;
156 switchToNextState("visible")
157 switchToNextState("visible")
157 }
158 }
tests/qmltests/Launcher/tst_Drawer.qml+21
@@ -311,5 +311,26 @@ StyledItem {
311
311
312 compare(launcher.lastSelectedApplication, "calendar-app");
312 compare(launcher.lastSelectedApplication, "calendar-app");
313 }
313 }
314+
315+ function test_focusMovesCorrectlyBetweenLauncherAndDrawer() {
316+ var panel = findChild(launcher, "launcherPanel");
317+ var drawer = findChild(launcher, "drawer");
318+ var searchField = findChild(drawer, "searchField");
319+
320+ launcher.openForKeyboardNavigation();
321+ tryCompare(panel, "highlightIndex", -1);
322+ keyClick(Qt.Key_Down);
323+ tryCompare(panel, "highlightIndex", 0);
324+
325+ launcher.openDrawer(true);
326+ tryCompare(searchField, "focus", true);
327+
328+ keyClick(Qt.Key_Escape);
329+
330+ launcher.openForKeyboardNavigation();
331+ tryCompare(panel, "highlightIndex", -1);
332+ keyClick(Qt.Key_Down);
333+ tryCompare(panel, "highlightIndex", 0);
334+ }
314 }
335 }
315}
336}