aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>2020-10-14 11:48:16 +0800
committerGeireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>2020-10-14 11:48:16 +0800
commit94a08418663fbb327542f7be9e3909f383c8bc33 (patch)
tree6ab15245955ef8c4fda8270a320dca7178ce8b64
parent6762d82992732eb14d7d2313d92cf0ae3a30f5a9 (diff)
Fixed bug showing up
cannot read ... of rect...
-rw-r--r--src/client/views/presentationview/PresElementBox.tsx10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client/views/presentationview/PresElementBox.tsx b/src/client/views/presentationview/PresElementBox.tsx
index 9052967e5..adaabec8a 100644
--- a/src/client/views/presentationview/PresElementBox.tsx
+++ b/src/client/views/presentationview/PresElementBox.tsx
@@ -190,11 +190,11 @@ export class PresElementBox extends ViewBoxBaseComponent<FieldViewProps, PresDoc
onPointerMove = (e: PointerEvent) => {
const slide = this._itemRef.current!;
- const rect = slide?.getBoundingClientRect();
- let y = e.clientY - rect.top; //y position within the element.
- let height = slide.clientHeight;
- let halfLine = height / 2;
- if (DragManager.docsBeingDragged.length > 1) {
+ if (slide && DragManager.docsBeingDragged.length > 1) {
+ const rect = slide.getBoundingClientRect();
+ let y = e.clientY - rect.top; //y position within the element.
+ let height = slide.clientHeight;
+ let halfLine = height / 2;
if (y <= halfLine) {
slide.style.borderTop = "solid 2px #5B9FDD";
slide.style.borderBottom = "0px";