Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(520)

Unified Diff: ios/web/web_state/ui/crw_context_menu_controller.mm

Issue 2639793002: Stop triggering context menu while scrolling (Closed)
Patch Set: Adressed feedback Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/ui/crw_context_menu_controller.mm
diff --git a/ios/web/web_state/ui/crw_context_menu_controller.mm b/ios/web/web_state/ui/crw_context_menu_controller.mm
index 335094014f101794112c7aaadf92ef4b442bfb73..707c129f9c037e9e1eafe70c55fe618481b63bf5 100644
--- a/ios/web/web_state/ui/crw_context_menu_controller.mm
+++ b/ios/web/web_state/ui/crw_context_menu_controller.mm
@@ -303,6 +303,14 @@ - (BOOL)gestureRecognizer:(UIGestureRecognizer*)gestureRecognizer
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer*)gestureRecognizer {
// Expect only _contextMenuRecognizer.
DCHECK([gestureRecognizer isEqual:_contextMenuRecognizer]);
+
+ // Context menu should not be triggered while scrolling, as some users tend to
+ // stop scrolling by resting the finger on the screen instead of touching the
+ // screen. For more info, please refer to crbug.com/642375.
+ if ([self webScrollView].dragging) {
+ return NO;
+ }
+
// Fetching is considered as successful even if |_DOMElementForLastTouch| is
// empty. However if |_DOMElementForLastTouch| is empty then custom context
// menu should not be shown.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698