diff --git a/src/aframe/components/clickDrag.js b/src/aframe/components/clickDrag.js index 7d22753..da76f7a 100644 --- a/src/aframe/components/clickDrag.js +++ b/src/aframe/components/clickDrag.js @@ -92,7 +92,7 @@ const { unproject } = (function unprojectFunction() { initialized = initialized || initialize(THREE); - vector.applyProjection(matrix.getInverse(threeCamera.projectionMatrix)); + vector.applyMatrix4(matrix.getInverse(threeCamera.projectionMatrix)); return localToWorld(THREE, threeCamera, vector); } @@ -540,6 +540,7 @@ const { didMount, didUnmount } = (function getDidMountAndUnmount() { removeDragListeners && removeDragListeners(); // eslint-disable-line no-unused-expressions removeDragListeners = undefined; + draggedElement = null; } function onTouchStart({ changedTouches: [touchInfo] }) { diff --git a/src/aframe/components/isDraggable.js b/src/aframe/components/isDraggable.js index ef64e2d..5439504 100644 --- a/src/aframe/components/isDraggable.js +++ b/src/aframe/components/isDraggable.js @@ -75,9 +75,11 @@ const isDraggable = { const id = this.el.getAttribute('uuid'); if (id && editorMode === MODE_COMPONENT_PLACING) { - const { x: field_x, y: field_y, z: field_z } = this.el.getAttribute( - 'position' - ); + const { + x: field_x, + y: field_y, + z: field_z + } = this.targetEl.getAttribute('position'); dispatch({ type: OPEN_EXPERIENCE_COMPONENT_EDIT, user,