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

Commit 130e41c8 authored by Diksha Gohlyan's avatar Diksha Gohlyan Committed by Android (Google) Code Review
Browse files

Merge "Refocus on 1st element when uncheck out of bounds" into mainline-prod

parents 131c684d f91c29c1
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);
                }
            }
        }
    }