diff options
author | anika-ahluwalia <anika.ahluwalia@gmail.com> | 2020-04-18 17:56:30 -0500 |
---|---|---|
committer | anika-ahluwalia <anika.ahluwalia@gmail.com> | 2020-04-18 17:56:30 -0500 |
commit | 04e2cdc30dd71cccb066f713a93cdc4d3bbd169c (patch) | |
tree | ebacc25b4b99ac74b4bf79c12d0ae17a46033b0b /src/Utils.ts | |
parent | a261ab5e9697277bec029803f1fa0c890f0c8fd5 (diff) | |
parent | 9f8e76451b807ed8f51ef32aab9b2255dfccd525 (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into script_documents
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 a8cde0624..58f272ba5 100644 --- a/src/Utils.ts +++ b/src/Utils.ts @@ -475,7 +475,9 @@ export function setupMoveUpEvents( e: React.PointerEvent, moveEvent: (e: PointerEvent, down: number[], delta: number[]) => boolean, upEvent: (e: PointerEvent) => void, - clickEvent: (e: PointerEvent) => void) { + clickEvent: (e: PointerEvent) => void, + stopPropagation: boolean = true +) { (target as any)._downX = (target as any)._lastX = e.clientX; (target as any)._downY = (target as any)._lastY = e.clientY; @@ -499,8 +501,10 @@ export function setupMoveUpEvents( document.removeEventListener("pointermove", _moveEvent); document.removeEventListener("pointerup", _upEvent); }; - e.stopPropagation(); - e.preventDefault(); + if (stopPropagation) { + e.stopPropagation(); + e.preventDefault(); + } document.removeEventListener("pointermove", _moveEvent); document.removeEventListener("pointerup", _upEvent); document.addEventListener("pointermove", _moveEvent); |