Explorar o código

[web] Account for page border when restoring scroll position in PDF preview (#5955)

GitOrigin-RevId: a5c74151e085db2e413ff27b46c67bff8c28487f
Alf Eaton %!s(int64=4) %!d(string=hai) anos
pai
achega
d7efa156f9

+ 5 - 0
services/web/frontend/js/features/pdf-preview/util/pdf-js-wrapper.js

@@ -175,6 +175,11 @@ export default class PDFJSWrapper {
       pageNumber: position.page + 1,
       destArray,
     })
+
+    // scroll the page down by an extra few pixels to account for the pdf.js viewer page border
+    this.viewer.container.scrollBy({
+      top: -9,
+    })
   }
 
   abortDocumentLoading() {