pairwise-tech / pairwise

The Pairwise Codebase
https://app.pairwise.tech
6 stars 0 forks source link

Fix for swipe gestures on Safari #219

Closed bonham000 closed 4 years ago

bonham000 commented 4 years ago

This PR:


I discovered it's a Safari bug, not restricted to mobile. Safari's TouchEvent is different from other browsers (see compatibility matrix...) so I had to figure out a different way to determine the source element of the event in Safari. I'm not sure if this is the best approach or not, but it appears to work as I can reproduce it locally and this fixes it. In addition, this approach should be more resilient to other failures in the future (e.g. I have no idea if it will work for IE), since it just uses try/catch. I'll feel better when we can test in production to be sure, it's harder to emulate swipe gestures on the iOS Simulator or in Safari.

Side note: Is there any way to get a Safari console for the iOS Simulator?