Fix for zooming in iOS 11.3

12 views
Skip to first unread message

Matt Parizeau

unread,
Apr 25, 2018, 8:30:40 PM4/25/18
to PDFTron WebViewer
iOS 11.3 broke a number of libraries and web apps by changing touch event handlers to be passive by default. WebViewer 3.2 includes a workaround for this change but if you're using an older version you can patch MobileReaderControl.js to fix the issue.

Find the code block in MobileReaderControl.js that starts with document.ontouchmove = ... and replace it with the following:
document.addEventListener('touchmove', function(e) {
 
if (!$.mobile.activePage.hasClass('custom-dialog') || (e.scale && e.scale !== 1)) {
    e
.preventDefault();
 
}
}, { passive: false });

Reply all
Reply to author
Forward
0 new messages