Skip to content

Pinch zoom with infinite-scroll mode would not stay in the same page #3069

@en-nicolabaesso

Description

@en-nicolabaesso

Hi! I'm having an issue, as provided in the title, with the pinch zoom gesture (on both Android and iOS devices) while setting the viewer in infinite-scroll mode.
Here's what I observe: when in 'multiple' page mode, I can zoom without issues on a single page. When I switch to the 'infinite-scroll' page mode, no matter what page I'm on, doing a pinch zoom would result in a scroll to the first page.
Below there's a video demonstrating the issue. I believe I'm missing something altogether, or I'm using the 'infinite-scroll' mode the wrong way. Is there a method to have the zoom focusing on a single page? I'm already detecting if I'm in a specific page by doing this (because, as I understand, in this mode the PDF is rendered as a single, very long page):

const pages=document.getElementsByClassName('page');
this.currentPage.set(Array.prototype.slice.call(pages).filter((el:HTMLDivElement)=>{
    const rectEl=el.getBoundingClientRect();
    let isScrolled: boolean;
    isScrolled=rectEl.top <= (window.innerHeight || document.documentElement.clientHeight)/2
    return isScrolled
}).length);

Below is a video example of the issue.
This issue also occurs while programmatically setting the zoom level.

screen-20251107-145303.mp4

Let me know if you need more informations about it. Thank you!

Describe the bug
I reproduced the issue this way:

  1. Load a multi-page PDF document (the issue is not related to a specific document)
  2. Set the viewer in 'infinite-scroll' page mode
  3. Scroll to a page > 1 (so not the first one)
  4. Do a pinch zoom gesture

Version info

  • Tested version is 23.3.1, on Angular 19

Metadata

Metadata

Assignees

Labels

25scheduled for version 25ConfirmedI've managed to reproduce the bug. That's great news: chances are I'll solve it.bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions