Can someone help me understand why is this useful and when to use it?
$( \"#sortable\" ).disableSelection();
Caveat emptor: .disableSelection()
is actually harmful on some browsers, as it prevents clicking active elements (e.g. textarea
s) inside the sortable.
.disableSelection()
prevents clicking on embedded textarea
; doesn't seem to have any effect otherwise (i.e. it is still impossible to select text with the mouse in the sortable if omitted).disableSelection()
seems to have no effect whatsoever.It's useful if you want to make text unselectable. If, for instance, you want to make drag-and-drop elements with text on, it'd be annoying to the user if the text on the box accidentally would get selected when trying to drag the box.
jQuery documentation says to not use it http://api.jqueryui.com/disableselection/
Also, I found that it made elements with contenteditable="true"
no longer editable.