mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-02-08 00:21:11 +01:00
The fixed -400px horizontal offset used by scrollIntoView led to horizontal scroll only moving part-way right on narrow screens. The highlights near the right-edge remained party or completely off screen. This centres the highlighted match on any viewport width while clamping the left margin to 20-400px. On very narrow screens the scrollbar now moves all the way to the right instead of stopping midway.