diff options
author | bobzel <zzzman@gmail.com> | 2022-06-07 13:39:17 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2022-06-07 13:39:17 -0400 |
commit | d3c89f90d376310cd583ae1c6ac4a7eb4c5a03ac (patch) | |
tree | 2b159f9a885a739cb27cdc9bff18935f0423e274 /src/Utils.ts | |
parent | 6493d95e92c8ed58bb3a8c07ea4ca28dae82ea1d (diff) |
fixed dragging items in overlayView to not invalidate DocumentView and cause a rerender. fixed loss of ability to select or drag after dragging a recording.
Diffstat (limited to 'src/Utils.ts')
-rw-r--r-- | src/Utils.ts | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Utils.ts b/src/Utils.ts index 6f3a31b49..07e95d438 100644 --- a/src/Utils.ts +++ b/src/Utils.ts @@ -698,6 +698,7 @@ export function setupMoveUpEvents( (target as any)._lastTap = Date.now(); (target as any)._downX = (target as any)._lastX = e.clientX; (target as any)._downY = (target as any)._lastY = e.clientY; + (target as any)._noClick = false; const _moveEvent = (e: PointerEvent): void => { if (Math.abs(e.clientX - (target as any)._downX) > Utils.DRAG_THRESHOLD || Math.abs(e.clientY - (target as any)._downY) > Utils.DRAG_THRESHOLD) { @@ -729,17 +730,20 @@ export function setupMoveUpEvents( clearTimeout((target as any)._doubleTime); (target as any)._doubleTime = undefined; } - clickEvent(e, (target as any)._doubleTap); + (target as any)._noClick = clickEvent(e, (target as any)._doubleTap); } document.removeEventListener("pointermove", _moveEvent); document.removeEventListener("pointerup", _upEvent); }; + const _clickEvent = (e: MouseEvent): void => { + if ((target as any)._noClick) e.stopPropagation(); + document.removeEventListener("click", _clickEvent, true); + } if (stopPropagation) { e.stopPropagation(); e.preventDefault(); } - document.removeEventListener("pointermove", _moveEvent); - document.removeEventListener("pointerup", _upEvent); document.addEventListener("pointermove", _moveEvent); document.addEventListener("pointerup", _upEvent); + document.addEventListener("click", _clickEvent, true); }
\ No newline at end of file |