diff options
author | mehekj <mehek.jethani@gmail.com> | 2021-07-31 15:39:27 -0400 |
---|---|---|
committer | mehekj <mehek.jethani@gmail.com> | 2021-07-31 15:39:27 -0400 |
commit | 2e1f7c626306a054c036c91a98e5dabee3b39ef8 (patch) | |
tree | 9a08876f93ecffbcc5f2cbd31b0797289fb188d2 /src/client/views/nodes/WebBox.tsx | |
parent | 11e95e35cde6e0c2390380975327f20eb5f3d1a4 (diff) | |
parent | 41ccf50f2b551edd6827c9fd6296b9ff87a65915 (diff) |
Merge branch 'master' into temporalmedia-mehek
Diffstat (limited to 'src/client/views/nodes/WebBox.tsx')
-rw-r--r-- | src/client/views/nodes/WebBox.tsx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/client/views/nodes/WebBox.tsx b/src/client/views/nodes/WebBox.tsx index 88e38712a..f5b1f96f2 100644 --- a/src/client/views/nodes/WebBox.tsx +++ b/src/client/views/nodes/WebBox.tsx @@ -162,7 +162,8 @@ export class WebBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProps scrollFocus = (doc: Doc, smooth: boolean) => { if (this._sidebarRef?.current?.makeDocUnfiltered(doc)) return 1; if (doc !== this.rootDoc && this._outerRef.current) { - const scrollTo = doc.type === DocumentType.TEXTANCHOR ? NumCast(doc.y) : Utils.scrollIntoView(NumCast(doc.y), doc[HeightSym](), NumCast(this.layoutDoc._scrollTop), this.props.PanelHeight() / (this.props.scaling?.() || 1)); + const windowHeight = this.props.PanelHeight() / (this.props.scaling?.() || 1); + const scrollTo = Utils.scrollIntoView(NumCast(doc.y), doc[HeightSym](), NumCast(this.layoutDoc._scrollTop), windowHeight, windowHeight * .1); if (scrollTo !== undefined) { const focusSpeed = smooth ? 500 : 0; this._initialScroll !== undefined && (this._initialScroll = scrollTo); |