PDA

View Full Version : [FIXED] Touchmove, Touchstart, Touchend targets wrong in iOS



roycyang
22 Apr 2012, 1:09 PM
REQUIRED INFORMATION

Ext version tested:

Touch 2.0.0GPL and 2.0.1RC
Browser versions tested against:

iOS 5.1
DOCTYPE tested against:

HTML5
Description:

When I have a touchmove event and I track the target, it works in Chrome but in iOS the touch target is ALWAYS the first thing I touched. Even if I drag my finger to a different element, the same element.id comes back again and again.
Steps to reproduce the problem:

Check out http://roycyang.github.com/sencha-touch-extensions/ in the debug console
Note how in Chrome or Safari if you click on the GT.FixedButton, the target changes when you move your cursor?
Doing the same thing in iOS gives you the wrong target
The result that was expected:

That the target element is actually what you are touching
The result that occurs instead:

The target never changes, is always the first thing you touched
Test Case:


https://github.com/roycyang/sencha-touch-extensions

HELPFUL INFORMATION

Screenshot or Video:

attached
Correct element IDs in chrome:
34360

The touchmove target never changes in iOS:

34361

See this URL for live test case: http://roycyang.github.com/sencha-touch-extensions/

mitchellsimoens
23 Apr 2012, 7:27 AM
Thanks for the report.

Qumhieh
30 May 2012, 11:52 PM
did you found any fix for this issue?!

s.t.a.s
23 Jul 2012, 12:01 PM
I need this fix too. Are there any solution?

A.Tyshchyk
29 Nov 2012, 12:24 AM
It's not fixed on ST2.1 (Build date: 2012-11-05 22:31:29)

The temporary solution:


onElementTouchMove: function(e) {
if (Ext.browser.is.ChromeMobile) {
var x = e.event.changedTouches[0].screenX;
var y = e.event.changedTouches[0].screenY;
} else {
var x = e.pageX;
var y = e.pageY
}
var target = document.elementFromPoint(x, y);
}