Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable ctrl+click to select text in IE 10?

In IE 10, when you click on any text while holding the CTRL key the browser selects the text (which means the text gains focus and I want to avoid this because I have some multi-select scenario where CTRL+click means add/remove-select).

How can I disable this "feature"?

BTW, I still want to be able to select the text using the usual mouse actions.

like image 415
Jajo Avatar asked Sep 17 '12 11:09

Jajo


People also ask

How do I turn off select text?

You can use the user-select property to disable text selection of an element. In web browsers, if you double-click on some text it will be selected/highlighted. This property can be used to prevent this.

How do I turn off text selection in react?

To disable the text selection highlighting in React, we can set the css property user-select to a value “none”. In the example above, we have added the browser prefixes for the user-select property, so it works the same in all browsers.

How do you turn off highlight in CSS?

To disable text selection highlighting in Google Chrome browser using CSS just set -user-select CSS property to none. And no prefix is required for Google Chrome and Opera Browsers.


1 Answers

This feature can be disabled by disabling selection completely.

This can be done by using -ms-user-select which has been introduced in IE10. (see also: http://ie.microsoft.com/testdrive/HTML5/msUserSelect/Default.html)

Example: To disable selection add the following css class to the element containing the text or one of its parents:

.notselectable
{
    -ms-user-select: none;
}
like image 92
alex3772 Avatar answered Sep 20 '22 04:09

alex3772