Skip to content
This repository has been archived by the owner on Mar 27, 2019. It is now read-only.

Click events fire twice in iscroll lite! #270

Closed
kevingil opened this issue Sep 21, 2012 · 7 comments
Closed

Click events fire twice in iscroll lite! #270

kevingil opened this issue Sep 21, 2012 · 7 comments

Comments

@kevingil
Copy link

Im using iscroll for an android app with a webview and when i click in something the action fires twice.
I tried this
https://groups.google.com/forum/#!topic/iscroll/XL2Ny9gpKc0
but it didnt work. Im running jellybean and I heard some people had problems with it too but I cant find a way to fix it.
ANY HELP???
edit: im using this version of i scroll lite
http://cubiq.org/dropbox/iscroll4/src/iscroll-lite.js?v4
What fires twice are some hyperlinks that open new activities in android

@AndersDJohnson
Copy link

Same problem here. Doesn't seem to affect Chrome for Android or iOS Safari. Just the default browser in
Android Jelly Bean 4.1. We were just about to release an app at work too. Help!

@AndersDJohnson
Copy link

@kevingil
Copy link
Author

in html href="javascript:void(0)" onclick="location.href=(' '); and in xml android:launchMode="singleInstance"

@ibrahimLincoln
Copy link

I found a fix to this. what was happening is that if I have link inside the iscroll 4 wrapper, on ipad 1, iOS5.1.1 once the new window opens, then when I close it, it triggers the same window again. some issue with iscroll.
if you experience this, the FIX is:

replace the following lines

onBeforeScrollStart: function (e) { e.preventDefault(); },
onScrollStart: null,

with the following

onBeforeScrollStart: function (e) { e.stopImmediatePropagation(); },
onScrollStart: function (e) { e.preventDefault(); },

@zookz
Copy link

zookz commented Jul 25, 2013

I fixed by the following:

$(selecter).on('touchstart', function(e) {
e.stopPropagation();
});

this will only fire once!

@diyism
Copy link

diyism commented Oct 28, 2013

I use on('tap',....) instead of onclick to avoid this problem.

cubiq pushed a commit that referenced this issue Oct 29, 2013
@cubiq
Copy link
Owner

cubiq commented Oct 29, 2013

I have implemented a pretty aggressive solution to this problem. Please update to the latest version and let me know.

@cubiq cubiq closed this as completed Oct 29, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants