diff options
author | bobzel <zzzman@gmail.com> | 2021-08-26 19:17:53 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2021-08-26 19:17:53 -0400 |
commit | 7c83bc30b3a6ed6061ef68bcef6a0e8941668b3c (patch) | |
tree | d213c1c545b6dc88e5bacc5185d5fc1fcbb5aea3 /src/client/views/pdf/PDFViewer.tsx | |
parent | 7a1b11bd9d71d4b414059b6cbc0ad518011f7cdd (diff) |
fixed resizing bug for web and pdf documents when doing autoheight gesture, and after opening the sidebar and then resizing
Diffstat (limited to 'src/client/views/pdf/PDFViewer.tsx')
-rw-r--r-- | src/client/views/pdf/PDFViewer.tsx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/client/views/pdf/PDFViewer.tsx b/src/client/views/pdf/PDFViewer.tsx index e77fdde3d..02010e123 100644 --- a/src/client/views/pdf/PDFViewer.tsx +++ b/src/client/views/pdf/PDFViewer.tsx @@ -119,9 +119,11 @@ export class PDFViewer extends React.Component<IViewerProps> { this._mainCont.current?.addEventListener("scroll", e => (e.target as any).scrollLeft = 0); this._disposers.autoHeight = reaction(() => this.props.layoutDoc._autoHeight, - () => { - this.props.layoutDoc._nativeHeight = NumCast(this.props.Document[this.props.fieldKey + "-nativeHeight"]); - this.props.setHeight(NumCast(this.props.Document[this.props.fieldKey + "-nativeHeight"]) * (this.props.scaling?.() || 1)); + autoHeight => { + if (autoHeight) { + this.props.layoutDoc._nativeHeight = NumCast(this.props.Document[this.props.fieldKey + "-nativeHeight"]); + this.props.setHeight(NumCast(this.props.Document[this.props.fieldKey + "-nativeHeight"]) * (this.props.scaling?.() || 1)); + } }); this._disposers.searchMatch = reaction(() => Doc.IsSearchMatch(this.props.rootDoc), |