cubiq / iscroll

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

snap jumps around on mobile (works perfect on desktop) #1153

Open eliteproxy7 opened 7 years ago

eliteproxy7 commented 7 years ago

I am using iScroll5 and this is my code

I have a 400px high 100% width div on the center of the screen and applying iScroll with snap.

    var myScroll = new IScroll('#roomList', {
                snap: 'md-list-item',
                probeType: 3,
                mouseWheel: true
            });
            myScroll.on('scrollEnd', function() {
            this.setactiveLater();
            }
             myScroll.on('scroll', function() {
             console.log(this.y);
            }

on Desktop it works as expected, on mobile (Safari and Chrome) at times when scroll and "let go" it snaps back to the original element that I started scrolling from. When i move it slowly and one off it works properly.

Could it be because sometimes when I release it is outside of the wrapper and that may cause this jump issue?