TouchSwipe-Jquery-Plugin icon indicating copy to clipboard operation
TouchSwipe-Jquery-Plugin copied to clipboard

Pinch on iOS not working

Open pcmaffey opened this issue 9 years ago • 7 comments

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.)

pcmaffey avatar Dec 20 '15 18:12 pcmaffey

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.

asolfer avatar Dec 22 '15 11:12 asolfer

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

mattbryson avatar Dec 23 '15 21:12 mattbryson

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.

voxelmator avatar Feb 17 '16 16:02 voxelmator

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

SlieT avatar Jul 06 '16 16:07 SlieT

Goodmorning,

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

xfacco avatar Jul 15 '16 08:07 xfacco

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 ([email protected]) 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 .

mattbryson avatar Jul 18 '16 07:07 mattbryson

I'm seeing this bug as well.

Love TouchSwipe!

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

justinputney avatar Jun 19 '17 22:06 justinputney