ThibaultJanBeyer / DragSelect

An easy JavaScript library for selecting and moving elements. With no dependencies. Drag-Select & Drag-And-Drop. – Examples:
https://dragselect.com/
Other
715 stars 81 forks source link

Feature Request: on dragstart using custom image #135

Closed n1crack closed 2 years ago

n1crack commented 2 years ago

how can I use custom image when dragging like :

el.addEventListener('dragstart', function (e) {
  const img = image_element;
  e.dataTransfer.setDragImage(img, 0, 15);
  e.dataTransfer.effectAllowed = 'all';
  e.dataTransfer.dropEffect = 'copy';
  e.dataTransfer.setData('data', 'test');
});

the events provided are returning MouseEvent, not DragEvent

n1crack commented 2 years ago

I got it done somehow.