Ok ... So to be sure that I understand ...
Because you advise to listen to the "mouseup" event, but the problem is actually that the "mouseup" event is NOT triggered (or actually is is just caught and stopped).
Do you mean that I should catch "dragend" on the rectangle (since I cannot catch "mouseup"), and "mouseup" on the whole svg, and then check the state over/out, and act in consequence !?