Login

Learning&Support

Documentation

How to prevent horizontally sliding HTML content to navigate to previous or next page.

Twixl Support Team Updated: - Created :

Problem

HTML content with sliders or other sliding effects, trigger the go-to-next or go-to-previous article behaviour.

Cause

This is caused by a behaviour change that Apple introduced in iOS 11.3.

From the release notes:

Updated root document touch event listeners to use passive mode improving scrolling performance and reducing crashes.

Source: https://developer.apple.com/library/archive/releasenotes/General/WhatsNewInSafari/Articles/Safari_11_1.html

Solution

This can be changed back to the pre-11.3 behaviour by setting the passive option on addEventListener to false.

Example:

someElement.addEventListener("touchmove", handleTouchMove, { passive: false });

Was this article helpful?

0 out of 0 found this helpful