jquery-archive/PEP

PEP stands down in iOS13 though the PE implementation is incomplete.

IanBellomy opened this issue ยท 13 comments

iOS13 only partially implements pointer events (https://caniuse.com/#feat=pointer) but PEP stands down because it appears that native support exists.

Is there a way to force PEP to kick in?

This appears to be fixed in iOS 13.1 which (from what I can tell) is going to get released in the next few days.

In the meantime, I've used patch-package to patch with this diff:

diff --git a/node_modules/pepjs/dist/pep.js b/node_modules/pepjs/dist/pep.js
index 2c9c00f..ef53368 100644
--- a/node_modules/pepjs/dist/pep.js
+++ b/node_modules/pepjs/dist/pep.js
@@ -746,8 +746,8 @@
   ];
   var styles = '';

-  // only install stylesheet if the browser has touch action support
-  var hasNativePE = window.PointerEvent || window.MSPointerEvent;
+  var isSafari = !!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/)
+  var hasNativePE = !isSafari && (window.PointerEvent || window.MSPointerEvent)

   // only add shadow selectors if shadowdom is supported
   var hasShadowRoot = !window.ShadowDOMPolyfill && document.head.createShadowRoot;
@@ -1418,9 +1418,9 @@
   };

   function applyPolyfill() {
-
+    var isSafari = !!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/)
     // only activate if this platform does not have pointer events
-    if (!window.PointerEvent) {
+    if (!window.PointerEvent || isSafari) {
       window.PointerEvent = PointerEvent;

       if (window.navigator.msPointerEnabled) {

The above doesn't seem to completely work. Looking into it more

The issue is indeed fixed for me on iOS 13.1 (released yesterday).

@nickschot
There are two PointerEvent issues I'm aware of: https://caniuse.com/#feat=pointer
Unfortunately, I just checked and they both persist in 13.1 on iPad.
@nickschot, which specific issue did you see gone on what device?

@nickschot
There are two PointerEvent issues I'm aware of: https://caniuse.com/#feat=pointer
Unfortunately, I just checked and they both persist in 13.1 on iPad.

Sure thing, I just noticed that what broke for me (I'm using PEP w/ babylonjs) worked again on iOS 13.1. I haven't looked into detail, but events seemed to (most of the time) not be intercepted properly causing scroll to happen instead of my desired action.

edit: this was on an iPhone SE

@nickschot
If I understand you, PEP is standing down in your project, as expected, in 13.1 AND you are no longer seeing an issue that you saw in 13.0, meaning iOS native pointer events are not causing any issues in your project?

Correct, I think? To clarify: I did not have any issue on iOS 12.x and also not on 13.1, just 13.0. As said before I did not dive into details. If there's anything specific you'd like me to check on iOS 13.1 please let me know :)

@nickschot Cool. Thanks. I'm fine assuming that there was a PE issue in 13.0 that I didn't know about that affected you but that got fixed for 13.1. Regardless, I'll still need to look into getting PEP to kick in on this end.

FWIW: The two PE issues have resolutions in the webkit bug tracker, but I'm not sure when they'll land in iOS. :/

i believe iOS 13.0 had an issue with not honoring touch-action:none properly - see https://www.youtube.com/watch?v=-OsFaibGlB0 . this is likely what was causing the weird behavior with scroll happening when it shouldn't. this has now been fixed now in iOS 13.1.

Does anyone know how to at least disable Point Events for a PWA in iOS13?

You can toggle it off for Safari proper in the experimental features section in settings, but it has no effect on sites added to the home-screen. So PWAs using PEP are real out of luck.

We'd love for PEP to fill in on Safari 13... seems like they haven't fully implemented for pointerover and pointerleave

Screen Shot 2019-10-09 at 1 56 45 PM

The releasePointerCapture(pid) and pointerEvent.buttons issues appear to be fixed in 13.2! ๐ŸŽ‰

PEP has now entered emeritus status at the OpenJS Foundation. This repository is now archived.