Bug 226848 - Touch events lost when a PWA goes into the background
Summary: Touch events lost when a PWA goes into the background
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: UI Events (show other bugs)
Version: Safari 14
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-06-09 13:41 PDT by Joshua Grass
Modified: 2021-11-30 07:57 PST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joshua Grass 2021-06-09 13:41:41 PDT
Progressive web apps that use:

document.addEventListener('touchstart', mantaTouchStart, false);

and other touch events lose the event listener when the application is put in the background and brought back to the foreground.

To reproduce:
1) Open a web page that uses a touch event (touchStart, touchEnd, touchMove...)
2) Touch events work fine
3) Go to the home screen - placing Safari in the background
4) go back to safari
5) touch events continue to work
6) Add the website to the homescreen
7) Open the PWA
8) Touch events work fine
9) Go the the home screen - placing the PWA in the background
10) Go back to the PWA
11) touch events no longer respond

Update still happens, so I've even tried adding code to re-add the touch listeners as part of the update.  That does not work either.  So I think, it is beyond just losing the touch event listener.  I think something has broken them when you switch to another app and back.

Touch events work fine in safari and work fine on android when a chrome web page is saved as a PWA, so I do not think it is developer error.
Comment 1 Radar WebKit Bug Importer 2021-06-16 13:42:18 PDT
<rdar://problem/79413969>