From b2005d4f63110ef876180b7b038b298e100b0e9c Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Mon, 31 Aug 2020 16:56:16 -0400
Subject: fixed scrolling of browser when following a link in nested web page
 that leads to another palce within that web page

---
 src/client/views/MainView.tsx | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

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

diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx
index 96a596f15..d479f0f78 100644
--- a/src/client/views/MainView.tsx
+++ b/src/client/views/MainView.tsx
@@ -80,6 +80,7 @@ export class MainView extends React.Component {
     propertiesWidth = () => Math.max(0, Math.min(this._panelWidth - 50, CurrentUserUtils.propertiesWidth || 0));
 
     componentDidMount() {
+        new InkStrokeProperties();
         DocServer.setPlaygroundFields(["dataTransition", "_viewTransition", "_panX", "_panY", "_viewScale", "_viewType", "_chromeStatus"]); // can play with these fields on someone else's
 
         DocServer.GetRefField("rtfProto").then(proto => (proto instanceof Doc) && reaction(() => StrCast(proto.BROADCAST_MESSAGE), msg => msg && alert(msg)));
@@ -107,7 +108,6 @@ export class MainView extends React.Component {
 
     constructor(props: Readonly<{}>) {
         super(props);
-        new InkStrokeProperties();
         MainView.Instance = this;
         CurrentUserUtils._urlState = HistoryUtil.parseUrl(window.location) || {} as any;
 
@@ -299,7 +299,7 @@ export class MainView extends React.Component {
     @computed get flyout() {
         return !this._sidebarContent || !this._flyoutWidth ? (null) :
             <div className={`mainView-libraryFlyout${this._flyoutWidth ? "" : "-out"}`} style={{ minWidth: this._flyoutWidth, width: this._flyoutWidth }} >
-                <div className="mainView-contentArea">
+                <div className="mainView-contentArea" >
                     <DocumentView
                         Document={this._sidebarContent}
                         DataDoc={undefined}
@@ -584,7 +584,7 @@ export class MainView extends React.Component {
     }
 
     render() {
-        return (<div className={"mainView-container" + (this.darkScheme ? "-dark" : "")} ref={this._mainViewRef}>
+        return (<div className={"mainView-container" + (this.darkScheme ? "-dark" : "")} onScroll={() => document.getElementById("root")!.scrollTop = 0} ref={this._mainViewRef}>
             {this.inkResources}
             <DictationOverlay />
             <SharingManager />
-- 
cgit v1.2.3-70-g09d2

