cubiq / iscroll

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

scrollEnd event fires twice if snap option is set to true #761

Closed samuelgoldenbaum closed 8 years ago

samuelgoldenbaum commented 10 years ago
myScroll = new IScroll('#wrapper', {
        scrollbars: true,
        mouseWheel: true,
        interactiveScrollbars: true,
        snap: true // this causes the scrollEnd event to fire twice
    });
    myScroll.on('scrollEnd', function(e) {
        console.log('done'); // scrollEnd event firing twice
    });

http://jsfiddle.net/ALgV3/

frankie-loves-jesus commented 10 years ago

Seems to me like it's interactiveScrollbars that's causing it?

samuelgoldenbaum commented 10 years ago

Seems that adding both snap and interactiveScrollbars causes the issue. Perhaps fire a different event for snap like 'snapEnd' . Unfortunately, I need both :-(

samuelgoldenbaum commented 10 years ago

Anyone have any pointers for a fix here?

notdotscott commented 9 years ago

Setting interactiveScrollbars to false still causes the issue, at least it does on that jsfiddle example.

fanmanpro commented 8 years ago

Still experiencing this issue. Is there a known fix/hack I can use?

sculove commented 8 years ago

@Fanus I will check it

sculove commented 8 years ago

iscroll fires two scrollEnd events when using mousewheel:true and snap:true options

sculove commented 8 years ago

I merged on master branch