<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>226848</bug_id>
          
          <creation_ts>2021-06-09 13:41:41 -0700</creation_ts>
          <short_desc>Touch events lost when a PWA goes into the background</short_desc>
          <delta_ts>2021-11-30 07:57:53 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>UI Events</component>
          <version>Safari 14</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Joshua Grass">joshua.grass</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>appleipadbetatester</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1768322</commentid>
    <comment_count>0</comment_count>
    <who name="Joshua Grass">joshua.grass</who>
    <bug_when>2021-06-09 13:41:41 -0700</bug_when>
    <thetext>Progressive web apps that use:

document.addEventListener(&apos;touchstart&apos;, 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&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1770364</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-06-16 13:42:18 -0700</bug_when>
    <thetext>&lt;rdar://problem/79413969&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>