Commit 8f794455 authored by Sky Malice's avatar Sky Malice Committed by Commit Bot

[Touchless] Cancel fling when focusing carousel child.

Bug: 982357
Change-Id: Idea7394705b9421a0ce4837e79da7e4a8b2fe529
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1694143Reviewed-by: default avatarCathy Li <chili@chromium.org>
Commit-Queue: Sky Malice <skym@chromium.org>
Cr-Commit-Position: refs/heads/master@{#676065}
parent 2e32e74b
......@@ -57,6 +57,10 @@ class SiteSuggestionsLayoutManager extends RecyclerView.LayoutManager {
RecyclerView parent, RecyclerView.State state, View child, View focused) {
if (focused != null) {
int newChildPos = getPosition(focused);
// Stop scrolling if we're in the middle of a swipe/fling, see https://crbug.com/982357.
parent.stopScroll();
scrollToPosition(newChildPos);
}
return true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment