title: Can't prevent navigation gesture in latest Chrome version (59) on mac
body: <p>Not being able to completely disable the two-finger swipe gesture to navigate through the browser history for a whole website is a constant annoyance to me. Up until this point, it was at least possible to prevent that behavior by calling preventDefault() on the mousewheel event. </p>
  
  <p>This does not seem to be working anymore in Chrome 59.</p>
  
  <h1>Here is how to reproduce it:</h1>
  
  <ol>
  <li>Start the gesture somewhere on the page, then cancel it</li>
  <li>From there on, preventDefault has no effect. </li>
  </ol>
  
  <p>Does anyone have a solution to this? </p>
  
  <h1>Examples</h1>
  
  <p><a href="https://zenkit.com" rel="nofollow noreferrer">Zenkit</a> and Airtable both call preventDefault when you scroll inside their table view. It seems to be working at first, but as soon as the gesture was recognized and then canceled at least once (outside the table, where prevent default is not called), preventing the gesture doesn't work anymore (even inside the table). So from there on, scrolling to the left inside the table is almost impossible because it always triggers the gesture. </p>
  
  <p>In Trello`s kanban view it only occurs if you're at the left or right edge of the scroller. But I guess that is because they use native scrolling while Zenkit and Airtable use css translation instead. </p>
  
  <p>I tried creating an invisible scroll container on top of the content once the user starts scrolling and removing it afterwards. This reduces the problem significantly but doesn't work in all of the cases. </p>
  
  <p>Example Code: 
  <a href="https://codepen.io/anon/pen/gRKaMX" rel="nofollow noreferrer">https://codepen.io/anon/pen/gRKaMX</a></p>
  
  <p>There are 3 boxes in this pen. </p>
  
  <ul>
  <li><p>The fist one scrolls natively using overflow: scroll. Here the gesture can only be triggered if scrollLeft is 0.</p></li>
  <li><p>The second one has an event listener attached that calls preventDefault on every mousewheel event. This prevents the gesture at first but once you started it anywhere else on the page, it doesn't work anymore. </p></li>
  <li><p>And lastly there is a third div that you can always start the gesture on.</p></li>
  </ul>
  
  <p>StackOverflow wants me to inline the code as well, so here it is:</p>
  
  <p>HTML:</p>
  
  <pre><code> Native Scrolling:
  &lt;div id="native-scrolling" class="box"&gt;
    &lt;div&gt;&lt;/div&gt;
   &lt;/div&gt;
  
  Prevent gesture by calling prevent default. Only works if you didn't start the gesture anywhere else, yet:
  &lt;div id="prevent-gesture" class="box"&gt;&lt;/div&gt;
  
  Just a normal div:
  &lt;div class="box"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>JavaScript: </p>
  
  <pre><code>$('#prevent-gesture').on('mousewheel', function (event) {
    event.preventDefault();
  });
  </code></pre>
  
  <p>CSS: </p>
  
  <pre><code>.box {
    height: 100px;
    width: 200px;
    background: black;
  }
  
  #native-scrolling {
    overflow: scroll;
  }
  
  #native-scrolling &gt; div {
    width: 200%;
    height: 10px;
  }
  </code></pre>
  
  <p>Thanks in advance, 
  Jesse</p>
  
  <h1>Edit: About the accepted answer</h1>
  
  <p>Restarting Chrome fixes this issue temporarily but it keeps coming back. I'm on Chrom 69 now and it still occurs.</p>