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

Commit b5ba6204 authored by Diksha Gohlyan's avatar Diksha Gohlyan
Browse files

Refocus on 1st element when uncheck out of bounds

Test: atest DocumentsUIGoogleTests
Bug: 163428206

Change-Id: I1ec8b4b146e39a490aa64b3e1c0ebad124417327
(cherry picked from commit f91c29c1)
parent 5cd4888e
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.provider.DocumentsContract;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.accessibility.AccessibilityEvent;
import android.widget.HorizontalScrollView;

import androidx.annotation.NonNull;
@@ -468,6 +469,10 @@ public class SearchChipViewManager {
            if (parent instanceof HorizontalScrollView) {
                final int scrollToX = isRtl ? parent.getWidth() : 0;
                ((HorizontalScrollView) parent).smoothScrollTo(scrollToX, 0);
                if (mChipGroup.getChildCount() > 0) {
                    mChipGroup.getChildAt(0)
                            .sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED);
                }
            }
        }
    }