I have made a codesandbox to illustrate my issue : https://codesandbox.io/p/sandbox/hvmg69
when dragging a ball outside of the blue box, it will start to spin fast and if I release the mouse while outside of the bounding box the element will continue to be dragged. I would like to release the ball if the mouse touches the bounding box.