-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Android default browser fire two click event #361
Comments
thanks for taking the time to experiment with iscroll. this will be hopefully fixed in iScroll 5. Unfortunately jQuery dependency is a no-go. |
Bug still exists in iScroll5 |
use |
ev.initMouseEvent('vclick', true, true, e.view is good solution for Android mobile but doesn´t work for IOS |
@santifdez it actually works on Jellybean 4.2 but doesnt on 4.1.2 / Samsung with TouchWiz (same webkit 4.0 Browser) |
This is (mostly) fixed in v5. v4 or earlier is not supported anymore. Please check out v5 if you have this issue. If you still run into this problem on v5, please comment here. Please provide as many details as possible. I will reopen then. |
I am seeing this problem with iScroll v5. I'm testing using the Android SDK: AVD_for_Nexus_One_by_Google, Android 4.3, API Level 18, CPU Intel Atom (x86). I'm using 4.3 instead of 4.4.2 (latest) because the latter doesn't support rotate to landscape properly. My setup is driven by Rails and I'm including: I debugged this a little and noticed that for every single tap I see: IScroll.prototype, handleEvent, mousedown IScroll.prototype, handleEvent, mousedown Since my setup already detects whether I am on a mobile device, I am working around this issue by using disableMouse: true |
This problem occurs for me with iScroll5 as well |
tap:true this works good,. |
i use iscroll5 ,set tap: true, but it still exists in android, there are two tap event fired. |
Still valid. |
Thank you for posting the issue and the solution. We had this issue with iScroll4. This was an incredibly time consuming, especially because we didn't knew the problem came from iScroll, and we actually thought there was a Ghost click that the native WebView was triggering. The fact that my android does not allow my chrome inspector to connect to the App's webview, didn't quite help ('old' version of Android [circa 4.2.x]). So, a big +1 for this thread. We did not try it with iScroll5 |
The event flow of android browser is different. You can fix it if your browser is mobile.
|
@sculove @cubiq - This was a pretty big breaking change which should have warranted a major version bump to |
@zivester The default values of disableMouse, disableTouch, disablePointer are decided automatically according to a browser. eg1. if the browser is able to use pointer and touch and mouse events, iScroll options are like this. disablePointer: false,
disableTouch: true,
disableMouse: true eg2. if the browser is able to use touch and mouse events, iScroll options are like this. disablePointer: true,
disableTouch: false,
disableMouse: true eg3. if the browser is able to use mouse event, iScroll options are like this. disablePointer: true,
disableTouch: true,
disableMouse: false I tested many devices. |
Well the defaults changed which is 100% a breaking change. We've tested this on numerous devices running chrome (Android 4, 5, iOS), of which we had declarations like the following: new Scroll($scrollWrapper, {
mouseWheel: true,
scrollbars: true,
bounce: true,
eventPassthrough: 'horizontal',
}); Touch events stopped being produced on these devices (and scrolling broke entirely). Scrollbars were still visible, and mouse events worked (when testing on Chrome Desktop). The offending line being:
Locking our application into |
No offense, but, every update to iscroll requires extensive testing and re-development due to the nature of the library I tested 5.2.0 for example, it seemed extremely fast and smoother with speed, however, none of the clicks was working for me, probably because I had countless modifications to the code at 5.1.3, one of which perfected the android clicks for 5.1.3 What should definitely be tested are inputs, if input clicks doesn't work, it might break sign ups etc., my .02 |
I'm not debating whether the updates are meaningful, but the detection and defaults you introduced in this commit do break existing installations. Do what you want with it, but we have locked into an older version while we make sure that our defaults are aligned to the pre I will fork this repo while removing the defaults introduced in this commit. If you'll accept a PR for the removal of these defaults on the |
If you are updating a library version without testing (or if you didn't That said, this library is worse than making html+js for old versions of On 03:37, Wed, Apr 20, 2016 zivester [email protected] wrote:
|
@zivester I couldn't produce your situation.
|
Obviously in this case, touch is being disabled because EDIT: Seem to have found the culprit, another library we're using, https://github.com/jquery/PEP which polyfills |
@zivester OK. |
i use iscroll-probe 5.2.0 ,set tap: true, but it still exists in android, there are two tap event fired. Tried in: options:
` |
if browser doesn't have events, a default value of disablePointer/Touch/Mouse options is 'true' - change default value about disablePointer,disableTouch, disableMouse options - don't attach unnesassray events. - fix two click/tap issue. Close cubiq#361
Hello,
I have noticed that the Android's default browser fire two click events on every DOM element when using iscroll with jquery and jquery mobile (no issue when using iscroll with jquery only).
This seems to be only with the default browser every thing is fine with Chrome (didn't test on other browser).
I noticed this issue with my Nexus 4 ( Android 4.2.2) and my Galaxy S (Cyanogen 9).
I have first thnik phonegap was the root cause but when using it on a web page (served by a remote http server) I had the same issue.
To fix this, I have changed click to vclick in line 558 in iscroll.js
ev.initMouseEvent('vclick', true, true, e.view ...
This seems to make iscroll acting fine and fixed my issue. This make iscroll depending on jquery and may need additionnal testing to ensure this doesn't break something else
I would like to know what you think on this and also this may help other users.
Thanks a lot
Best Regards.
Florent
The text was updated successfully, but these errors were encountered: