Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

fix for vanishing items #392

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions angular-drag-and-drop-lists.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@
* which is the primary way we communicate with the target element
*/
element.on('dragstart', function(event) {
// stop dragging when selection mode is active in browser
// if you do not do this, items will vanish in thin air
var selObj = window.getSelection();
if (selObj.rangeCount > 1){
selObj.removeAllRanges();
return false;
}
event = event.originalEvent || event;

// Check whether the element is draggable, since dragstart might be triggered on a child.
Expand Down