cubiq / iscroll

Smooth scrolling for the web
http://iscrolljs.com
MIT License
12.87k stars 3.81k forks source link

iOS 11.3 (Safari 11.1) Breaks & My Solution #1232

Open jongmoon opened 6 years ago

jongmoon commented 6 years ago

By updating iOS 11.3, iScroll is affected by a Safari 11.1 change. I think #1231 could be related with this updates.

It is passive mode policy.

https://developer.apple.com/library/content/releasenotes/General/WhatsNewInSafari/Articles/Safari_11_1.html#//apple_ref/doc/uid/TP40014305-CH14-SW2

You can find that

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

If you use preventDefault option as true(it's default), you would not worry about it. it will work OK.

But If you use preventDefault option as false, you should check touchmove handler (which does e.preventDefault()) on root document have {passive:false} like following.

var myScroll = new IScroll('#wrapper', {
  preventDefault: false
}

// You should check touchmove handler have `passive:false`
document.addEventListener('touchmove', function (e) {e.preventDefault();}, {
  passive: false
});

Is there any solution?

bindToWrapper option is true, passive:false is not needed.

Calinas commented 6 years ago

Hi, thanks. Your solution did work in my case.Saves a lot of trouble and time.