jQuery UI sortable & selectable

前端 未结 5 418
难免孤独
难免孤独 2020-12-13 02:45

Does anybody know how to combine jQuery UI selectable and sortable ? This script: http://nicolas.rudas.info/jquery/selectables_sortables/ doesn\'t work in Chrome and it also

5条回答
  •  情话喂你
    2020-12-13 03:10

    Part of my jQuery base-arsenal includes the following, as it's usually annoying when you go to drag something and end up selecting text instead...

    // disables text selection on sortable, draggable items 
    $( ".sortable" ).sortable();
    $( ".sortable" ).disableSelection();
    

    Not sure if you can just flip the "disable" to "enable", but there's my $.02. Without trying it though.. common sense suggests that you may need to define an inactive section within the same "group" element, to provide a "handle" for the drag action.... or else those clicks may relentlessly be mistaken as the intent to select/edit...

提交回复
热议问题