What is disableSelection used for in jQuery UI?

前端 未结 3 1407
余生分开走
余生分开走 2021-02-04 23:00

Can someone help me understand why is this useful and when to use it?

$( \"#sortable\" ).disableSelection();
3条回答
  •  清酒与你
    2021-02-04 23:24

    Caveat emptor: .disableSelection() is actually harmful on some browsers, as it prevents clicking active elements (e.g. textareas) inside the sortable.

    • Firefox 33.1 for Mac OS X (Yosemite): .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)
    • Chrome 39.0.2171.71 (64-bit) for Mac OS X: .disableSelection() seems to have no effect whatsoever.

提交回复
热议问题