//transition the joystick position back to center
//stick.style.transition = '.2s';
//stick.style.transform = `translate3d(0px, 0px, 0px)`;
// reset everything
//self.value = { x: 0, y: 0 };
While this solves the return to zero on lift it also brings an issue : on next drag the stick will return to zero by itself before it moves. This disturbs the usage but also creates an offset between the touch point and the stick and this offset is maintained until next lift, so essentially the stick is no longer under the mouse or finger anymore when i drag it.
i am not sure what causes this exactly, i suspect it is related to the distance/motion calculation but it is not clear what is wrong, if you have an idea, it is welcome.