b-zurg/react-collapse-pane

fix: dragging does not always stop when mouse click is done

b-zurg opened this issue · 2 comments

Sometimes, in strange circumstances, it seems the dragging does not stop after the mouse click is done. I think another event listener on mouse up will probably take care of this issue.

This is because of the issue that mouseUp is not called when the pointer is not in the bounds of the initial element anymore. This would typically not be a problem but if you go out of bounds and then release the mouse then the event listener for mouseDown is still active and the drag continues.

The issue is described here: https://stackoverflow.com/questions/12348737/jquery-mouseup-not-firing-after-drag-off-link

This is the expected behaviour of the api and simply something that needs to be coded for.

http://jsfiddle.net/jWkCT/

I found this fiddle by digging around more on stackoverflow and found this https://stackoverflow.com/questions/11533098/how-to-catch-mouse-up-event-outside-of-element

This seems to be exactly what's needed.