Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a891919a authored by Saho Kobayashi's avatar Saho Kobayashi
Browse files

Fix focus transition when the direction is backward.

Currently, when SearchView is focused, the focus is moved to the
internal view. This blocks users to move the focus back to the previous
view by Shift + Tab.
Send focus to the previous view instead of the internal view when the
direction is backward.

Bug: 191405735
Test: atest SearchViewTest SearchView_CursorTest
Change-Id: I668ce13472b80da2e57e84fac4966294d7848170
parent b2b2a5d0
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -492,6 +492,13 @@ public class SearchView extends LinearLayout implements CollapsibleActionView {
        if (!isFocusable()) return false;
        // If it is not iconified, then give the focus to the text field
        if (!isIconified()) {
            if (direction == FOCUS_BACKWARD) {
                final View found = focusSearch(FOCUS_BACKWARD);
                if (found != null) {
                    return found.requestFocus(FOCUS_BACKWARD, previouslyFocusedRect);
                }
                return false;
            }
            boolean result = mSearchSrcTextView.requestFocus(direction, previouslyFocusedRect);
            if (result) {
                updateViewsVisibility(false);