selecto
selecto copied to clipboard
SelectEnd event has a isDragStart boolean?
...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
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
When isDragStart is true, it is as follows.
- When forcibly stopped in the dragStart event
- 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.