-
-
Notifications
You must be signed in to change notification settings - Fork 422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to disable scroll on page change? #460
Comments
I want to know how to solve that issue too. |
You can don't set the [page] by removing |
Hi, same issue for me, any news about this problem ? |
Also an issue for me. If I am navigating from page to page, my Next and Previous button move out of the visible screen when it snaps to the viewer. |
Please anybody have a solution for this issue. |
Hey there! I still have this problem. How I suppose to disable the scroll on top when page changes? Using
in |
I have found a workaround that doesn't involve directly changing the pdfjs module. So what you need to do is to capture on your component the PdfViewerComponent. Then you can access the pdfviewer and inside there is an object call scroll.down and you can set it to false. And that's it you will no longer have scrolling when changing pages. Angular Component
HTML
|
Hello, I still have the issue in v7. The problem comes from pdfjs viewer. When the page changes, it makes the parent container scroll to show the viewer on top of it. I came up with a (ugly but working) workaround : adding a fake scrollable wrapper around the pdf container. When pdfjs will search for a scrollable container, it will find this one instead of the main one.
demo : https://stackblitz.com/edit/ng2-pdf-viewer-zwjsbj?file=src/app/app.component.html |
Simplified: decreasing the height by 1px didn't fix it, but increasing it by 1px did. I used the following everywhere, it prevents scrolling up:
I have have [show-all] true/false, enabling/disabling scrollbars by styling etc. It still works. Of course you can add that styling to your css file. The reason @edcoumont version worked, is because he increased the fake-wrapper's width by 50px. |
Bug Report or Feature Request (mark with an
x
)Every time I change a page, it automatically scroll to the begining document. Is there any way to disable it?
Here is my code:
<pdf-viewer [src]="pdfObj.url" [show-all]="false" [stick-to-page]="flase" [(page)]="currentPDFPage" [original-size]="false" style="display: block;" [rotation]="rotation" [zoom]="zoom" (error)="onError($event)" (after-load-complete)="afterLoadComplete($event)"> </pdf-viewer>
The text was updated successfully, but these errors were encountered: