Closed admolofto closed 3 years ago
Solved it myself. In case anybody is looking this up, I just added mousedown and mouseup listeners to the items and checked the mouse x and y coords after mouseup to see if there was any change.
also look at this one https://github.com/vaheqelyan/svelte-grid/issues/25
Under certain circumstances, I have my draggable items working as buttons (i.e. when the user clicks on an item, an event fires). Unfortunately, whenever I finish dragging an item, the onClick function of the item will fire.
What is the best way to prevent this from happening? How do I tell Grid that the user is dragging an item, not clicking it.
React-grid has an 'onDrag' function that fires after the user has dragged an item. The method they recommend is to set a timeout that doesn't allow the functions to fire if an item was just dragged. Is there something similar I can implement here?
Again, thanks for all your hard work!