Commit 424b30f9 authored by Olivier Robin's avatar Olivier Robin Committed by Chromium LUCI CQ

Reset overscroll actions if no action is selected.

By quickly retrigger overscroll actions, you can be in a state where no
action is selected but offset is big enough to trigger action.
In this case, Overscroll action is stuck in this state.

Bug: 1003766
Change-Id: I2071a120e475bfc0bb95f2bddd216bbcb960f916
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2578984
Auto-Submit: Olivier Robin <olivierrobin@chromium.org>
Reviewed-by: default avatarChris Lu <thegreenfrog@chromium.org>
Reviewed-by: default avatarRobbie Gibson <rkgibson@google.com>
Commit-Queue: Olivier Robin <olivierrobin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#836576}
parent 476e192f
...@@ -452,8 +452,12 @@ NSString* const kOverscrollActionsDidEnd = @"OverscrollActionsDidStop"; ...@@ -452,8 +452,12 @@ NSString* const kOverscrollActionsDidEnd = @"OverscrollActionsDidStop";
self.scrollViewDragged = NO; self.scrollViewDragged = NO;
// Content is now hidden behind toolbar, make sure that contentInset is // Content is now hidden behind toolbar, make sure that contentInset is
// restored to initial value. // restored to initial value.
// If Overscroll actions are triggered and dismissed quickly, it is
// possible to be in a state where drag is enough to be in STARTED_PULLING
// or ACTION_READY state, but with no selectedAction.
if (contentOffset.y >= 0 || if (contentOffset.y >= 0 ||
self.overscrollState == OverscrollState::NO_PULL_STARTED) { self.overscrollState == OverscrollState::NO_PULL_STARTED ||
self.overscrollActionView.selectedAction == OverscrollAction::NONE) {
[self resetScrollViewTopContentInset]; [self resetScrollViewTopContentInset];
} }
......
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