From 6cd80efe5a467ce3f4eef31db589f6ccddd84f49 Mon Sep 17 00:00:00 2001
From: bob <bcz@cs.brown.edu>
Date: Wed, 5 Jun 2019 09:26:10 -0400
Subject: follow text links on pointer up. prevent web page changing when
 dropping URL onto Dash.

---
 src/client/views/MainView.tsx | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

(limited to 'src/client/views/MainView.tsx')

diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx
index a093ffdec..42d5929bf 100644
--- a/src/client/views/MainView.tsx
+++ b/src/client/views/MainView.tsx
@@ -170,6 +170,12 @@ export class MainView extends React.Component {
         }
     }
 
+    onDrop = (e: React.DragEvent<HTMLDivElement>) => {
+        e.preventDefault();
+        e.stopPropagation();
+        console.log("Drop");
+    }
+
     @action
     onResize = (r: any) => {
         this.pwidth = r.offset.width;
@@ -203,7 +209,7 @@ export class MainView extends React.Component {
         const pres = mainCont ? FieldValue(Cast(mainCont.presentationView, Doc)) : undefined;
         return <Measure offset onResize={this.onResize}>
             {({ measureRef }) =>
-                <div ref={measureRef} id="mainContent-div">
+                <div ref={measureRef} id="mainContent-div" onDrop={this.onDrop}>
                     {content}
                     {pres ? <PresentationView Document={pres} key="presentation" /> : null}
                 </div>
-- 
cgit v1.2.3-70-g09d2

