diff options
author | bob <bcz@cs.brown.edu> | 2019-06-05 09:26:10 -0400 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2019-06-05 09:26:10 -0400 |
commit | 6cd80efe5a467ce3f4eef31db589f6ccddd84f49 (patch) | |
tree | 238f6cb5856ae9693e73af54413e846177effd67 /src/client/views/MainView.tsx | |
parent | 7d3ef1c914cc1cc0b6c05b14773a8b83e1b95c96 (diff) |
follow text links on pointer up. prevent web page changing when dropping URL onto Dash.
Diffstat (limited to 'src/client/views/MainView.tsx')
-rw-r--r-- | src/client/views/MainView.tsx | 8 |
1 files changed, 7 insertions, 1 deletions
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> |