10

Using the Surface, it is possible to hold your finger on a link and get an option to copy it. This is undesired behavior for me. This can be disabled in iOS with:

-webkit-touch-callout: none;

does anyone know how to disable it for IE ?

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
Eugene Gordin
  • 4,047
  • 3
  • 47
  • 80

3 Answers3

9

named slightly differently for everything else.

-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
bizzehdee
  • 20,289
  • 11
  • 46
  • 76
  • 1
    I tried to add these rules too, but it doesn't work...I am still able to get an option to copy a link after holding my finger on it... – Eugene Gordin Feb 21 '13 at 22:14
  • 1
    hmmn, its entirely dependent on the particular implementation of the particular version of the browser on this working at all. what you might want to try is having jquery or some other library go through all your anchors and remove the href, and set data-url to what the href was, then hooking click for each anchor and triggering the navigation with javascript by reading out data-url. that way, there is no href to copy – bizzehdee Feb 21 '13 at 22:17
  • 1
    The OP's described behavior was a problem for me as well. I have a custom context menu I want to appear when people tab-hold, however, adding the above to the body CSS disabled the context menu altogether, which was not the fix I was looking for... – patrick Oct 19 '18 at 11:07
4

You might be looking for:

-ms-touch-select:   none;
-ms-touch-action:   none;

Together with above, I also use this on body{} for auto hiding scrollbars in IE 10:

-ms-overflow-style: -ms-autohiding-scrollbar;

There are more here: http://msdn.microsoft.com/en-us/library/windows/apps/hh996923.aspx

ahhhbuddye
  • 86
  • 3
4

You can also cancel the default response by binding an event callback to the contextmenu event. This works in IE for touch like it always has in all browsers for mouse:

window.addEventListener("contextmenu", function(e) { e.preventDefault(); })
Chris Love
  • 3,740
  • 1
  • 19
  • 16