aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/PDFBox.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/PDFBox.tsx')
-rw-r--r--src/client/views/nodes/PDFBox.tsx20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/client/views/nodes/PDFBox.tsx b/src/client/views/nodes/PDFBox.tsx
index 0aeb9afc8..8daea2541 100644
--- a/src/client/views/nodes/PDFBox.tsx
+++ b/src/client/views/nodes/PDFBox.tsx
@@ -38,13 +38,29 @@ export class PDFBox extends DocComponent<FieldViewProps, PdfDocument>(PdfDocumen
() => this.props.Document.scrollY,
() => {
if (this._mainCont.current) {
- this._mainCont.current && this._mainCont.current.scrollTo({ top: NumCast(this.Document.scrollY), behavior: "smooth" });
+ this._mainCont.current && this._mainCont.current.scrollTo({ top: NumCast(this.Document.scrollY), behavior: "auto" });
}
- });
+ }
+ );
}
+ @action
componentDidMount() {
if (this.props.setPdfBox) this.props.setPdfBox(this);
+
+ this._scrollY = NumCast(this.Document.startY);
+ this.props.Document.scrollY = this.Document.startY;
+ // let ccv = this.props.ContainingCollectionView;
+ // if (ccv) {
+ // ccv.props.Document.scrollY = this.Document.startY;
+ // }
+ }
+
+ componentWillUnmount() {
+ let ccv = this.props.ContainingCollectionView;
+ if (ccv) {
+ ccv.props.Document.scrollY = this.Document.startY;
+ }
}
public GetPage() {