title: Discern contextmenu events which are result of touch action?
body: <p>I have an application where elements inside of a SVG element can be drag and dropped (thanks to <a href="https://github.com/d3/d3-drag" rel="noreferrer">d3-drag</a> and <a href="https://github.com/d3/d3-zoom" rel="noreferrer">d3-zoom</a>, see <a href="https://bl.ocks.org/mbostock/3127661b6f13f9316be745e77fdfb084" rel="noreferrer">https://bl.ocks.org/mbostock/3127661b6f13f9316be745e77fdfb084</a> as an example for such a page) which can be also used on touch-enabled devices but what happens is that after a long press a context menu pops up (at least in IE11, Edge and Firefox) and is in the way, therefore I want to prevent the context menu from showing up in this case.</p>
  
  <p>I could just disallow showing the context menu in general by handling the <code>contextmenu</code> event and doing <code>.preventDefault()</code> on the event object but I wonder whether a solution exists where the context menu is just blocked from showing in the touch case and it would still show up for e.g. right-clicks or when the <a href="https://en.wikipedia.org/wiki/Menu_key" rel="noreferrer">menu key</a> is pressed while the element has focus.</p>
  
  <p>I thought at first I could look at the <code>.button</code> and <code>.buttons</code> properties of the event object but it seems like those values are arbitrarily <code>0</code> or <code>2</code> and it looks like it can be found in any combination when testing in various browsers on different systems.</p>
  
  <p>The element already has <code>touch-action: none</code>.</p>
  
  <p><strong>Is there some working way to make the context menu just not show up a result of a touch long-presses?</strong></p>
  
  <p><a href="https://github.com/d3/d3-drag/issues/9" rel="noreferrer">It looks like <code>.preventDefault()</code> on the relevant touch events wouldn't be an option.</a></p>