diff options
author | andrewdkim <adkim414@gmail.com> | 2020-02-11 20:33:06 -0500 |
---|---|---|
committer | andrewdkim <adkim414@gmail.com> | 2020-02-11 20:33:06 -0500 |
commit | c708b8f40617263b5d19c37cd4364ea1a6af4138 (patch) | |
tree | 860f153ee67da6410d605b624a68fbb1b8138952 /src | |
parent | b62a1e3d940f03272cd20acd64e768ff093867c6 (diff) |
fixing bugs
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/GestureOverlay.tsx | 1 | ||||
-rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 11 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/client/views/GestureOverlay.tsx b/src/client/views/GestureOverlay.tsx index 663541022..5bf217974 100644 --- a/src/client/views/GestureOverlay.tsx +++ b/src/client/views/GestureOverlay.tsx @@ -141,6 +141,7 @@ export default class GestureOverlay extends Touchable { const nts = this.getNewTouches(te); if (nts.nt.length < 5) { const target = document.elementFromPoint(te.changedTouches.item(0).clientX, te.changedTouches.item(0).clientY); + te.changedTouches.item(0).identifier; console.log(te.touches); target?.dispatchEvent( new CustomEvent<InteractionUtils.MultiTouchEvent<React.TouchEvent>>("dashOnTouchStart", diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index 572b81b19..aa07db2a0 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -144,8 +144,7 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu } handle1PointerHoldMove = (e: Event, me: InteractionUtils.MultiTouchEvent<TouchEvent>): void => { - console.log(SelectionManager.SelectedDocuments()); - console.log(SelectionManager.GetIsDragging(), this); + const pt = me.touchEvent.touches[me.touchEvent.touches.length - 1]; if (this._firstX === -1 || this._firstY === -1) { @@ -339,7 +338,7 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu handle1PointerDown = (e: React.TouchEvent, me: InteractionUtils.MultiTouchEvent<React.TouchEvent>) => { SelectionManager.DeselectAll(); if (this.Document.onPointerDown) return; - const touch = InteractionUtils.GetMyTargetTouches(me, this.prevPoints, true)[0]; + const touch = me.touchEvent.changedTouches.item(0); console.log("DOWN", SelectionManager.SelectedDocuments()); console.log("down"); if (touch) { @@ -368,7 +367,8 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu this.removeMoveListeners(); } else if (!e.cancelBubble && (SelectionManager.IsSelected(this, true) || this.props.parentActive(true) || this.Document.onDragStart || this.Document.onClick) && !this.Document.lockedPosition && !this.Document.inOverlay) { - const touch = InteractionUtils.GetMyTargetTouches(me, this.prevPoints, true)[0]; + + const touch = me.touchEvent.changedTouches.item(0); if (Math.abs(this._downX - touch.clientX) > 3 || Math.abs(this._downY - touch.clientY) > 3) { if (!e.altKey && (!this.topMost || this.Document.onDragStart || this.Document.onClick)) { this.cleanUpInteractions(); @@ -522,11 +522,14 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu } onPointerUp = (e: PointerEvent): void => { + this.cleanUpInteractions(); + if (this.onPointerUpHandler && this.onPointerUpHandler.script && !InteractionUtils.IsType(e, InteractionUtils.PENTYPE)) { this.onPointerUpHandler.script.run({ this: this.Document.isTemplateForField && this.props.DataDoc ? this.props.DataDoc : this.props.Document }, console.log); document.removeEventListener("pointerup", this.onPointerUp); return; } + document.removeEventListener("pointermove", this.onPointerMove); document.removeEventListener("pointerup", this.onPointerUp); this._doubleTap = (Date.now() - this._lastTap < 300 && e.button === 0 && Math.abs(e.clientX - this._downX) < 2 && Math.abs(e.clientY - this._downY) < 2); |