Skip to content

fix(pdfviewer): stop the mouse wheel from zooming on touch platforms - #2559

Open
Ortes wants to merge 1 commit into
syncfusion:masterfrom
Fullphysio:fix/pdfviewer-mouse-wheel-zooms-on-touch-platforms
Open

Ortes wants to merge 1 commit into
syncfusion:masterfrom
Fullphysio:fix/pdfviewer-mouse-wheel-zooms-on-touch-platforms

Conversation

@Ortes

@Ortes Ortes commented Sep 10, 2026

Copy link
Copy Markdown

Fixes #2558.

Problem

On a touch platform driving a precise pointer — iPadOS or Android with a physical mouse — the mouse wheel zooms SfPdfViewer instead of scrolling it.

SfPdfViewer already scrolls the document on a wheel PointerScrollEvent, through its root Listener_handlePointerSignalPdfScrollableState.receivedPointerSignal. The InteractiveViewer behind the pages consumes the very same event as a scale gesture (InteractiveViewer._receivedPointerSignal scales for anything that is not a trackpad), and it does not go through the PointerSignalResolver, so both run on every tick and the zoom dominates.

Scaling was disabled for that reason, but only on desktop:

  • _isScaleEnabled was initialised to !kIsDesktop,
  • it was toggled from touch pointers only when kIsDesktop,
  • and scaleEnabled: was forced to true whenever !kIsDesktop.

That leaves every touch platform permanently scale-enabled, including while the active pointer is a mouse.

Fix

Gate scaling on the pointer kind rather than on the platform. _updateScaleEnabled enables scaling while a touch pointer interacts with the viewer and disables it otherwise, on every platform, and the kIsDesktop special-casing around scaleEnabled is dropped.

Pinch-to-zoom is unchanged: the flag is armed on touch down, well before a scale gesture can win the arena. The wheel is now left entirely to _handlePointerSignal.

Desktop behaviour is unchanged — _isScaleEnabled was already false there and armed by touch pointers.

Test plan

I have tested this on my own setup — an iPad with a physical mouse — and it fixes the reported problem: the wheel scrolls the document instead of zooming it. I have not tested it anywhere else, so the points below are what I believe a reviewer should check rather than results I can vouch for:

  • iPad + trackpad: two-finger scroll pans, pinch zooms.
  • iPhone / Android: pinch-to-zoom, double-tap zoom and single-finger pan behave as before, in both PdfPageLayoutMode.continuous and single.
  • Desktop and mobile web: wheel scrolls, pinch on a touchscreen zooms — unchanged.

SfPdfViewer already scrolls the document on a mouse wheel PointerScrollEvent
through _handlePointerSignal. The InteractiveViewer behind the pages scales on
the very same event, so the wheel zooms instead of scrolling.

Scaling was disabled for that reason on desktop only (_isScaleEnabled was
initialised to !kIsDesktop and toggled from touch pointers), which leaves every
touch platform that can host a precise pointer broken: iPadOS or Android with a
mouse zooms in on wheel up and out on wheel down, and only scrolls once the zoom
is clamped.

Gate scaling on the pointer kind instead of the platform: scaling is enabled
while a touch pointer interacts with the viewer and disabled otherwise, on every
platform. Pinch-to-zoom is unaffected, and the wheel now only scrolls.
@Vikassekar Vikassekar added bug Something isn't working pdf viewer PDF viewer component labels Sep 16, 2026
@AbinayaSF4962

Copy link
Copy Markdown

Hi @Ortes ,

Thank you for sharing your proposal and providing the patch to an issue where mouse wheel zooms instead of scrolling on iPadOS/Android with a physical mouse.
The reported behavior is a known Flutter framework limitation where mouse wheel input on touch-based platforms (such as iPadOS and Android with a physical mouse) is handled as a zoom gesture rather than a scroll gesture. Since this behavior originates from Flutter's InteractiveViewer, it cannot currently be addressed from the Syncfusion side.

Please note that, although the Flutter PDF library source code is publicly available on GitHub for transparency, we do not accept direct contributions to the repository. This policy ensures consistency and quality across all releases. Nevertheless, your feedback and suggestions are highly valued, and we encourage you to continue sharing ideas through our official support channels.
Thank you for your understanding and continued support.

Regards,
Abinaya E

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working pdf viewer PDF viewer component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[syncfusion_flutter_pdfviewer] Mouse wheel zooms instead of scrolling on iPadOS/Android with a physical mouse

3 participants