selecto icon indicating copy to clipboard operation
selecto copied to clipboard

SelectEnd event has a isDragStart boolean?

Open jimmywarting opened this issue 3 years ago • 2 comments

...that's confusing to me. a selectEnd event can't have a drag start? makes no sense.

i have spent a grate amount of time now trying to have a draggable element and also using selecto at the same time and finally got it the way i wanted. was something about live select and select on end mixing that made some bad behaviors. it was buggy for a while. I simply just clicked an element without dragging and the isDragStart was still saying that it was true while i haven't even moved the mouse one bit.

But also it seems you don't use the native drag and drop event looking at the evt.inputEvent.type after selectEnd indicates that the event is of type mousedown event (based on this assumption it seems like you are trying to emulate some of the drag events using only mousedown+mousemove+mouseup events?) wouldn't it benefit if you used native dragstart, dragend and drag event instead? and used some elm.draggable properties instead? i could not find them in the registered event listener anywhere in the chrome inspector

jimmywarting avatar Sep 27 '20 01:09 jimmywarting

using

<div class="viewport selecto">
  <p id="p1" draggable="true">This element is draggable.</p>
</div>

Instead of having selectableTargets would also make more since

jimmywarting avatar Sep 27 '20 01:09 jimmywarting

@jimmywarting

When isDragStart is true, it is as follows.

  1. When forcibly stopped in the dragStart event
  2. When the selectFromInside option is false and you select from the inside

In the above case

The dragEnd event is called directly from the dragStart event.

daybrush avatar Oct 17 '20 21:10 daybrush