NEW 222654
Scrolling in home screen apps incorrectly latches to document
https://bugs.webkit.org/show_bug.cgi?id=222654
Summary Scrolling in home screen apps incorrectly latches to document
Liam DeBeasi
Reported 2021-03-03 07:39:29 PST
Created attachment 422079 [details] Code reproduction When using an app added to the home screen, scrolling incorrectly latches to #document, making it impossible for users to interact with the app. Steps to reproduce: 1. Open the attached code reproduction on an iOS device. 2. Add the code reproduction to the home screen and then launch it. 3. Verify that you can scroll the main content. 4. Tap the input and then close the keyboard. 5. Swipe up on the header element. 6. Immediately after this, attempt to scroll on the main content. You should not be able to. If you were to inspect this using Safari Dev Tools and add a scroll listener, you should notice that the scroll event's target during step 6 is "#document". Sometimes I can get WebKit to re-latch to the main content, but I am not sure what causes that to happen. Expected Behavior: I would expect WebKit to never latch to #document for scrolling and continue to latch to the main content. Actual Behavior: WebKit latches to the #document for scrolling. Additional Information: - This was tested on iOS 14.5, but I can reproduce this on earlier versions of iOS 14. - This only happens when the app is installed to the homescreen. Running this in Safari does not reproduce the issue. - This does not happen when running the app inside of WKWebView in a Capacitor or Cordova application.
Attachments
Code reproduction (5.19 KB, text/html)
2021-03-03 07:39 PST, Liam DeBeasi
no flags
Simon Fraser (smfr)
Comment 1 2021-03-03 10:12:50 PST
I believe there are two issues here: 1. the document is scrollable on home screen web apps when it should not be (bug 214781) 2. UIKit has a bug where, if an ancestor scroll view is rubber banding, you have to wait for it to stop before you can scroll the inner scroll view (tracked internally).
Radar WebKit Bug Importer
Comment 2 2021-03-10 07:40:16 PST
Lincoln Baxter, III
Comment 3 2022-06-03 06:24:50 PDT
Any updates on this? We are struggling to control the very strange user interactions this causes on our full-page website.
tgels
Comment 4 2022-07-01 03:04:36 PDT
This bug is impacting the user experience for many webkit users worldwide that are using PWA's. Can we expect any progress on fixing this issue in the (near) future?
alex
Comment 5 2023-06-26 07:35:18 PDT
Hi there! This impact me, too. Video here: https://github.com/ionic-team/ionic-framework/issues/27697
alex
Comment 6 2023-07-06 15:00:30 PDT
Hi there. Sorry for the dupe comment. I just wanted to relay that this issue has been reported to me more times than I can count *just in the past 48 hours* by users of wefwef (https://wefwef.app). It's even worse that I previously thought. Any time the user tries to swipe during a page transition where pointer events are disabled, Safari will latch scroll to the document. Users then try to scroll the feed once the animation is complete, but they're stuck! The latching time is also juuuust long enough that users don't wait enough for it to unlatch, and they think the page is frozen. Here's a few users in the wild complaining about this very specific bug from the last *60 minutes*: > Scrolling also sometimes gets “frozen” briefly when returning to my feed. This happen to anyone else? > Yes to the freezing. It needs a second or two before you can scroll. Resolving this is really important for webapps installed to the homescreen.
Lincoln Baxter, III
Comment 7 2023-07-18 09:38:34 PDT
Yep, this is still a major issue in 2023. We've implemented a number of hacks to make this occur less frequently, but they are indeed hacks.
pi.coderman
Comment 8 2024-06-04 10:20:05 PDT
body { overflow: hidden; width: 100%; height: 100%; overscroll-behavior: none; }
Note You need to log in before you can comment on or make changes to this bug.