-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Touch events not working in Android 4.4.2 #1729
Comments
same here, with #master branch |
Also noticed this, nothing else to add really but this is a pretty big issue. |
So, can you guys be more specific? Are you talking about all touch events, or only the new gesture based ones? Can you share a demo of what you are trying to do? |
Not all touch events, and not even all gesture-based events. Specifically the swipe-related directives. Working: Not working (one out of 10-50 tries): Not tried: Don't have a demo, no codepen, as everything works on web browsers... but a simple hello world Cordova app should do the trick. Will see if I can find some time to put one together. Let me know. |
HelloSwipe showing a sample of the gesture problems: https://drive.google.com/file/d/0B1ClGdseCfJdRlhzWWxLMUs5REU/edit?usp=sharing This is a Cordova 3.3 project with only Android platform installed, using Ionic nightlies. |
Thanks @marcsyp, I can reproduce this now. Digging in... |
Note, my first attempt at resolving this will be to bind touchcancel in the same way touchend is bound. |
Any thoughts? Make sure you check out the JQuery Mobile issue link above, it may give you some insight. |
Shim working now : |
@TNT-RoX Hi Andrew, when you say shim working - that requires changes to Ionic to permit that shim to work? Thank you for helping on this |
@alexbainbridge Hi, not really it should fire it's own swipe events on the elements you want. The android swipe issues are rather complex. As @perrygovier correctly states binding touchcancel to touchend will solve the kitkat issue. However older android devices will stop sending touch events to webview if preventDefault is not set; and if it is set, native scrolling is prevented (less than ideal). So if you want native scrolling and swipe events across all android versions use my shim(in beta). It overlays a contained native scrolling element that is 300% larger and centered, and converts the scroll offsets to swipe events before re-centering the element. |
I'm on android 4.3 and accessing my app through my network, When I am dragging out my Is this issue have something to do with what I am experiencing? |
I have other touch issues but maybe they are related. I have a side-menu that contains a content panel which contains a list of clickable items. I can open the panel but when clicking on any item nothing happens. But scrolling is working. This is working with no problems on iOS and Desktop Browsers. Even when using Desktop Chrome emulation for mobile touch events. |
+1 After some investigation, found that if "scroll" is false in then tap events work (but then I cannot od that since my content goes beyond the screen size of a 5'' phone) |
This fits in nicely with some larger changes we'd like to make after the 1.0 |
Any updates on this issue? @TNT-RoX I'm using Ionic cards and still unable to get the shim to work. I've added "_ezswipe" class to swipeable cards, but still can't swipe on Android 4.4.2 or Android 4.4.4. |
@DEllingsworth I'm sorry, but this seems like a stupid mistake from my side. Please ignore. |
This is also not working for me, I tried to use drag events to replicate very simple version of 9 point mobile lock. Everything works fine on the desktop but on mobile it selects only the first point and does nothing while dragging. There is alert at the drag end that shows the combination you selected, and that fires correctly on the dragend event. So I suppose dragstart and dragend are fine, but drag isn't . I seen above someone said it woud be good to fix after version1, which is a little surprising, I mean ionic is framework for hybrid apps, I would think that touch events would be among the highest priorities... You can clone the repo here: https://github.com/Tomino2112/ionic-mobile-lock I didn't do almost anything with it, so simply add platform (android) and build. I have been testing it on Nexus 5, Android 5.0.1 |
@Tomino2112 You may want to see if using mnTouch for those gestures will fix the issue for now, as it worked with our issue with onhold |
mn-touch worked as a replacement for on-swipe-left and on-swipe-right for me and my 4.4.4 phone. Was very easy to implement as a replacement (add mn dependency, add mn-touch to the element and change on-swipe-right and on-swipe-left to swipe-right and swipe-left, respectively). Vertical scrolling of my overflow-scroll list was unaffected. |
@SashaGeekette I don't really see easy way to implement mntouch, it takes care of swiping, but I really need dragging. |
@rafaellop I'm sorry but I'm not seeing the differences in you codepen examples. |
Please give the nightly build a test to see if it fixes your issues with this fix: a5881ea |
I can test it couple of hours |
Ok, I am happy to tell you that the drag event is being triggered correctly now. BUT there is still problem that is fatal for my app. After a lot of debugging I noticed that the event target doesn't change while dragging. This means if I have a div with .class1 and another div with .class2 when I drag over from .class1 to .class2 , the target of the event is still .class1 (drag event is attached to the parent of these two) What I do in my script is on every drag fire I check "does the e.target=.class2 element?" if yes, do something, if not, ignore. This sounds to me like some bug in HammerJS? By the way I checked the e.gesture.target, same thing Works fine on desktop. |
👍 Thanks! @adamdbradley 's patch fixes the touchcancel issue for me too! It appeared after I updated a Samsung Galaxy Tab 3 device to Android 4.4.2 (from 4.0 something). The first touchmove event (drag respectively) was fired reliably, but immediately followed by touchcancel, which results in a release event by the ionic-ified hammer.js implementation. |
Ildar 25.03.2015, 11:50, "Ildar Kayumov" notifications@github.com:Hi, i'm using Ionic Version: 1.0.0-rc.0. It's good working on web, but when i run on real device app didn't show swipe animation, but swipe is working. Maybe i didn't understand the swipe animation process on Android and it didn't show that animation on Android. For example, You can repeat that using only browser Google Chrome:
Thank you. —Reply to this email directly or . |
on-release is not working for me guys. |
Hey, I think there was a regression regarding the fix above with this commit from 19 Mar. Maybe @perrygovier can have a look into this? What exactly do you mean by "Prevent gestures from breaking native scrolling"? Is there a use/test case? I could't find a related issue. @abeninski There is a work around. You have to pass edit: Here is a codepen that demonstrates the issue: http://codepen.io/MartinMa/pen/vOEmVR To get it up and running on your Android device, run the following commands using Ionic CLI.
|
I have also encountered a problem with "on-hold" not working on galaxy S6 android 5.0.2
my ionic cli is version 1.3.22 though the current project was created with one of the earlier versions |
Please reopen this issue or should a new one be created? |
Please open a new issue, this is different enough from the original issue. |
On-hold events sometimes is not working, testing with motog android 5.0.1 |
It appears that Android 4.4.2 is not playing nicely with touch events. Using the on-swipe directives in Ionic is extremely unreliable, with swipe events detected only 1 in 10 or 1 in 50 times on a Samsung Galaxy S5 or Nexus 5. Swipe detection is fine in earlier Android versions.
This appears to be similar if not identical to an issue that is known to be causing problems in other frameworks like JQuery Mobile. Some reference material:
JQM issue (still open):
jquery-archive/jquery-mobile#5534 (comment)
Android shim (workaround):
https://github.com/TNT-RoX/android-swipe-shim
I would also be interested in understanding why the swipes for ion-slide-box are unaffected...
The text was updated successfully, but these errors were encountered: