I have a dom element with a specific class name, and I'm trying to move this element to a specific point in the screen after the user finished dragging it.
In order to do that, my plan is to create a temp dom element in the position I want to move the point to, move the original element, and then remove the temp element.
Here's my code
```
gsap.registerPlugin(Draggable, MotionPathPlugin)
const selector = ".my-obj";
Draggable.create(selector, {
type: "x,y",
onDragEnd: function (e: any) {
const pointTag = document.createElement("temp-point-tag");
pointTag.style.position = 'absolute';
pointTag.style.top = 200 + window.scrollY + "px";
pointTag.style.left = 400 + window.scrollX + "px";
pointTag.style.width = "3px"
pointTag.style.height = "3px"
pointTag.style.backgroundColor = "red"
document.body.appendChild(pointTag);
const point = MotionPathPlugin.convertCoordinates(pointTag, document.querySelector(selector), { x: 0, y: 0 })
gsap.to(selector, { x: point.x, y: point.y });
},
});
```
My code doesn't work as expected. It doesn't have a static behaviour. If I dragged the object. it goes to a random place in the screen, and might also go outside the screen.
The expected behaviour for `MotionPathPlugin.convertCoordinates`, as I understand from the documentation, is to move to {x:0, y:x} relative to the object's coordinates which I specified.
Why is `MotionPathPlugin.convertCoordinates` not working? What is the correct way to move an object to a specific point(x,y) in the screen?
Sample codepen: I'm trying to move the red square to the red dot after dragging event has ended https://codepen.io/abozanona/pen/wvZMdLd