Skip to content

Commit

Permalink
fix(draggable): remove dragged element after its released
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickocoffeyo committed Aug 1, 2018
1 parent 0a3ed6a commit 3e53075
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/aframe/components/clickDrag.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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] }) {
Expand Down
8 changes: 5 additions & 3 deletions src/aframe/components/isDraggable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 3e53075

Please sign in to comment.