mozilla / mozilla/pdf.js

[Feature]: Feature request: configurable Ctrl+scroll wheel zoom sensitivity

Open
#21,297 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature requires-feedback-from-ux-ui viewer
Dominant language
JavaScript
Stars
53.9k
Forks
10.7k
Avg merge
18h 38m
Merged PRs (30d)
130

Description

Is the feature relevant to the Firefox PDF Viewer?

Yes

Feature description

Summary

The Ctrl+scroll zoom handler in the PDF.js viewer derives its scale delta from the raw wheel event deltaY. On Windows (and likely other platforms), users who configure a high "lines per notch" scroll speed in OS mouse settings produce large deltaY values per wheel tick. This causes the viewer to jump through zoom levels in very large steps (e.g. 100% → 370% per notch), making fine zoom control with the mouse wheel impractical.

There is currently no way for embedders or users to configure the sensitivity of Ctrl+scroll zoom.

Steps to reproduce

On Windows, set mouse scroll speed to a high value (Settings → Bluetooth & devices → Mouse → "lines to scroll" = 10 or higher).
Open any PDF in the PDF.js viewer.
Hold Ctrl and scroll the mouse wheel by one notch.
Observe: zoom jumps by a very large step. Fine control requires multiple slow reverse-scrolls to recover.
Expected behaviour

The zoom step per wheel notch should either be capped to a fixed maximum (e.g. 10–15% per notch), or be configurable via a viewer parameter such as wheelZoomSensitivity (default 1.0, lower = slower zoom).

Notes

This is distinct from issue #14476 (which was a Firefox/Wayland regression causing exponential jumps). That issue is fixed. The present report is about the user-facing configurability of the sensitivity on platforms with high OS-level scroll speed.

A simple clamp in the wheel handler — deltaY = Math.sign(deltaY) * Math.min(Math.abs(deltaY), MAX_DELTA) — would address the most common case without a new API. Alternatively, exposing wheelZoomSensitivity as a PDFViewerApplicationOptions entry would give embedders control.

Platform

OS: Windows 11 Pro (high scroll speed configured)
Viewer context: LaTeX Workshop VS Code extension (PDF.js embedded in a VS Code webview)

Other PDF viewers

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the PDF.js viewer's Ctrl+scroll zoom handler and reviewing PDFViewerApplicationOptions, both referenced in the request. Resolve whether the change should cap deltaY or expose wheelZoomSensitivity, then verify that high Windows scroll settings produce controlled, configurable zoom steps.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.