This issues happens when you start dragging the spectrogram and then move the mouse outside the spectrogram area. In that case the mouseup event doesn't fire so dragging never ends and you're stuck in drag mode.
Two ways we can fix this:
Handle the mouseout event and end the ongoing drag. So when you start dragging and move outside the spectrogram dragging will end.
Register the mousemove and mouseup events on the document instead of the spectrogram. That way users can continue dragging even if the mouse is outside the spectrogram area. Dragging will only end when you lift mouse pointer up.
Both are equally straightforward to implement. Option 1 seems more harsh on the user because dragging will end if you leave even by just one pixel.
I went for option 2 but can change to option 1 if necessary.
Fix #52
This issues happens when you start dragging the spectrogram and then move the mouse outside the spectrogram area. In that case the
mouseup
event doesn't fire so dragging never ends and you're stuck in drag mode.Two ways we can fix this:
mouseout
event and end the ongoing drag. So when you start dragging and move outside the spectrogram dragging will end.mousemove
andmouseup
events on thedocument
instead of the spectrogram. That way users can continue dragging even if the mouse is outside the spectrogram area. Dragging will only end when you lift mouse pointer up.Both are equally straightforward to implement. Option 1 seems more harsh on the user because dragging will end if you leave even by just one pixel.
I went for option 2 but can change to option 1 if necessary.