Preventing a mousewheel event is not reliable to block swipe navigation
Reported by
dhon...@evernote.com,
Apr 24 2017
|
||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36 Steps to reproduce the problem: 1. Open a new tab and go anywhere. 2. Go to google.com to have a back history. 3. Try to swipe left to perform swipe navigation but don't finish it - stay on the page. 4. Type mousewheel block in devtools: document.addEventListener('mousewheel', function(evt) { evt.preventDefault(); }, false); 5. Try swipe navigation again - it's not blocked What is the expected behavior? What went wrong? Whenever a mousewheel event is prevented, it should also block Chrome navigation. It was working in the old Chrome version. Also, if you skip the 3rd step, it will work. Don't forget to close the tab and try the all steps (except the 3rd one) again. It seems, whenever swipe navigation occurs, then preventing a mousewheel event has no effect. Did this work before? N/A Chrome version: 57.0.2987.133 Channel: n/a OS Version: OS X 10.12.4 Flash Version:
,
Apr 24 2017
Could you mind to explain a bit more on your steps? > 3. Try to swipe left to perform swipe navigation I think by "swipe left to perform swipe navigation" you meant to swipe from left to right to perform "go back" navigation. Is that correct? > but don't finish it - stay on the page. I can't understand how not to finish it and stay on the page. When I tried, it performs "go back". What operation did you do that?
,
Apr 24 2017
> I think by "swipe left to perform swipe navigation" you meant to swipe from left to right to perform "go back" navigation. Is that correct? Yes I opened Chrome again and I'm on 58.0.3029.81 version. I can't reproduce it anymore. Hopefully, it was only a bug of 57.0.x version and was not caused by other side effects. > What operation did you do that? My goal was to block "go back" navigation by a swipe on a page without horizontal scroll. Let's say I have a page which has a mouseevent listener and shows you deltaX/Y numbers as you scroll by two-finger gesture on a touchpad. When I scrolled (swipe) from left to right, it caused "go back" navigation. However, when I tried to block it by preventing default on a mousewheel event, it was not always working. My simple test to reproduce it was following: 1. open a page which is not horizontally scrollable and have a history stack to perform "go back". 2. add a listener to preventDefault of any mousewheel event Expected result would be that "go back" navigation does not occur. It was working only if no "go back" navigation occurred in that tab, before the first preventDefault of a mousewheel event. When I tried these steps: 1. open a page which is not horizontally scrollable and have a history stack to perform "go back". 2. perform swipe navigation 3. add a listener to preventDefault of any mousewheel event It did not block it.
,
Apr 24 2017
Thank you for providing more feedback. Adding requester "kojii@chromium.org" to the cc list and removing "Needs-Feedback" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Apr 24 2017
Closing as per the comment #3. > I opened Chrome again and I'm on 58.0.3029.81 version. I can't reproduce it anymore. Thank you for taking time to report this to us. |
||||
►
Sign in to add a comment |
||||
Comment 1 by nyerramilli@chromium.org
, Apr 24 2017