Closed kimleng closed 10 years ago
We hit a similar problem. Either you built two instances and forgot to use destroy() to remove the double event handlers, or, are you seing this on Android 4.0.x ?
I will detail my code as following:
page = {
iScroll : undefined,
init : function(){
var options = {
mouseWheel: true,
probeType: 3
}
// Here I check device that I want to add click event.
// On ios device, if we don't add click event, it won't handler. But android will.
// But if we add click event to both ios and android, android will fired twice times.
if(os == ios){ // This line, I am just example only
options.click = true;
}
if(page.iScroll==undefined){
page.iScroll = new IScroll("#target",options);
page.iScroll.on('scroll', page.updateContent);
page.iScroll.on('scrollEnd', page.updateContent);
document.addEventListener('touchmove',function(e){e.preventDefault();},false);
}
},
updateContent : function(){
//do something
}
}
Even I have checked device os to add click event. But on iphone, some element fired once, and some element fired twice. And one more thing on iphone 4, when we were scrolling the content with images, it seem not smoothly. Also on LG Devices, iScroll v5 doesn't work smoothly on it. It is too slow while I am scrolling content either with images or without images.
I just found that some elements that fired twice times if I apply click event "({ click:true })" to iphone. Those elements are button object.
yes, you need click: true for ios and android to fire the click, and yes stock android will fire it 2 times : see https://github.com/cubiq/iscroll/pull/548 where I did the fix for android
I did not see double clicks on ios. Perhaps it is because you registered double click handlers ?
For us v5.0.6 is smooth but I did not test with images. Did you use :hover on images ?
same problem. Ios fire twice the buttons.
For example, Bootstrsap modal create a button and it fire twice in ios with click=true.
The modal appear and disappear immediatly.
So a solution for now is use only <a>
but is not a good solution.
i'm waiting a 5.0.7 with correction fix!!!
can you confirm this on the latest version?
seem to be fixed now. (5.09 version )
version 5.2.1 still has this issue!
Duplicate #742?
Yup, should be a duplicate and i can confirm that 5.1.2 still has this issue (chrome desktop).
Seeing the same problem in 5.1.1. Is this fixed in the newest 5.1.3? @cubiq Please re-open ticket. Seems like the problem still exists and has not been fixed in 5.0.9
Still has the problem with v5.1.3 ....
@salcott how about using iScroll v5.2.0 ?
iScroll v5.2.0 ~ (c) 2008-2016 Matteo Spinelli ~ http://cubiq.org/license mac chrome 52.0.2743.82 (64-bit)
iscroll-probe.js:264 Uncaught TypeError: Cannot assign to read only property 'view' of object '#
hello, I have a problem with click event on iScroll 5. Some elements, they fired only one time. But some elements, they fired twice times. Even I changed to tap, it is also same issue. How should I do?