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

Event On isDragging Ended #136

Closed AndrewPixel closed 2 years ago

AndrewPixel commented 2 years ago

Is there any event which lets me know when the user has stopped dragging the selected elements eg something like isDraggingEnd ?

I need to run some code and I'd rather not run it continually while isDragging is true but once when isDragging ends.

AndrewPixel commented 2 years ago

Oops, I should've asked this in discussions and not issues, my bad.

ThibaultJanBeyer commented 2 years ago

Hi Andrew and thanks for using the tool!

Yes for sure, if you check the docs for callbacks, there is callback which is triggered on every end of interaction. So in your case you’d look for true on the isDragging callback object key.

After having a look I agree that the docs could be improved here, I hope I’ve some time to improve them soon!

Yes this should have been a discussion. Can you please still, even tho’ I answered you, re-post your question in the discussion section for future engineers? Thank you!