mattbryson / TouchSwipe-Jquery-Plugin

TouchSwipe is a jquery plugin to be used with jQuery on touch input devices such as iPad, iPhone etc.
http://labs.rampinteractive.co.uk/touchSwipe/
Other
4.05k stars 1.68k forks source link

Pinch on iOS not working #274

Open pcmaffey opened 8 years ago

pcmaffey commented 8 years ago

Tried on your demo page: http://labs.rampinteractive.co.uk/touchSwipe/demos/Pinch_and_Swipe.html

From iPhone, iOS 9.2.

(Also, when I add the pinch function to my code, it disables scrolling.)

asolfer commented 8 years ago

Hi,

I have the same problem. I make my own workaround. I hope that the author verified and improve them for all users of this library. In iOS evt,identifier doesn't return 1 for touches[1] and I make this changes in function updateFingerData,

function updateFingerData( id, evt ) {
  //var id = evt.identifier !== undefined ? evt.identifier : 0;
  var f = getFingerData(id);

  if (f === null) {
    f = createFingerData(id, evt);
  }

  f.last.x = f.end.x;
  f.last.y = f.end.y;

  f.end.x = evt.pageX || evt.clientX;
  f.end.y = evt.pageY || evt.clientY;

  return f;
}

Of course in all calls of function changed I put the param id... ....

  //Update the  finger data
  var currentFinger = updateFingerData( 0, evt);
  endTime = getTimeStamp();

...

... } else { //Else just update the second finger updateFingerData( 1, touches[1] ); endTouchesDistance = calculateTouchesDistance(fingerData[0].end, fingerData[1].end); pinchDirection = calculatePinchDirection(fingerData[0].end, fingerData[1].end); } ....

I don't know if there are another better solution. Thanks in advance.

mattbryson commented 8 years ago

Thanks for the report, I'll have a look into it.

voxelmator commented 8 years ago

I confirm I get the same problem : swipeStatus is not returning a correct fingerData on a true iOS device (iPad or iPhone), although it works correctly under Safari for OSX, or under iPad "emulation" in Chrome for OSX.

Using asolfer's mod, it works correctly, but I am not sure all functionalities are still working fine (if ID is set to "0" everywhere in the source, are the other fingers recognized correctly ?). Matt, is an updated "official" correction in preparation ? I'd rather use the "official" version of TouchSwipe. Thank you.

SlieT commented 8 years ago

Will this bug ever be fixed? I can't pinch in and out on my iPad.

xfacco commented 8 years ago

Goodmorning,

is'it fixed this bug? else I try to resolve it.

mattbryson commented 8 years ago

I’m afraid not, have no time at the moment.

Feel free to fork it and submit a fix if you get anywhere.

cheers

m

Matt Bryson

On 15 July 2016 at 09:24:14, Corrado Facchini (notifications@github.com) wrote:

Goodmorning,

is'it fixed this bug? else I try to resolve it.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mattbryson/TouchSwipe-Jquery-Plugin/issues/274#issuecomment-232892274, or mute the thread https://github.com/notifications/unsubscribe-auth/AAhgVPUM0Mxf9Xqg62oibdRuFTRJdM-_ks5qV0OugaJpZM4G44Fj .

justinputney commented 7 years ago

I'm seeing this bug as well.

Love TouchSwipe!

@mattbryson hope you have time to fix it at some point. :-)