How to disable text selection in webkit browsers when using jQuery UI.draggable?

I cannot disable text selection in webkit browsers when using jQuery UI.draggable (). I tried using webkit-specific css (-webkit-user-select and -webkit-user-drag) in various combinations, but had no luck.

Here's the jsfiddle where you can reproduce the problem: http://jsfiddle.net/dmosher/8ZGLR/

+2
source share
1 answer

disableSelection is your friend here.

.disableSelection () is undocumented (at the moment). This is useful for creating text elements or elements that contain text, not text of your choice. For example, if you have a draggable item, you may not want the text selection to occur when the user drags the item.

You might want to create an assistant so that it is obvious that something is being dragged.

Updated demo

+2
source

Source: https://habr.com/ru/post/919205/


All Articles