-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Freezing main thread on iOS Safari #130
Comments
Why would collapsing events with rAF make the problem worse? And you say this only happens if you have a scrollable element inside a not-otherwise-scrollable window? |
As mentioned, I'm not really familiar with Oh, and just realized what you meant by “rAF” ( |
After some more testing I found that the originally described behavior does not occur if the page is not already “docked” at the top or bottom. I.e. if there's a scroll in progress it's completely possible to scroll past the top or bottom of the document with springing action per usual. It's only once the page comes to a rest and a scroll in an unexpected direction (above the top of the document or below the bottom) that the issue comes into play. I also did some additional rough timing and it appears that the minimum duration between the last interaction and the end of the “frozen” behavior is closer to 200ms than it is the originally reported ~1s. This is still significant since it's the duration from the last interaction, so as long as a user is trying to swipe the page will be locked. |
Any thoughts on what's happening here, @taion? |
I don't really know, sorry. Can you explain your reasoning why You could try to add some logging to see what's getting called. |
I explained previously, but to be clear I don't know if I narrowed in on this specific call to
If you record this interaction you'll see something like this: The calls shown in purple occur only during the “freeze” scenario; once it alleviates, scrolling normally produces the composites shown in green in the second grouping where there are no calls to the |
I'm not seeing this on the Figma search on my phone. Note also that we're not setting scroll position in the Again, the point of the rAF call is exactly to defer and debounce these updates. You can test a more aggressive debouncing scheme if you'd like, but I'm not seeing the issue you're reporting. |
Hmm, just to confirm, you went into the search and tried scrolling in the results on iOS and didn't see the same behavior? I can reproduce this reliably (100% success) on multiple iOS devices (iPhone XS Max, iPhone 8+, iPad Pro 12.9"), all relatively up to date. |
I recorded a quick video to show you what I mean. It doesn't show taps, but the sequence of events is: open nav, tap into search, type “desi”, tap “Done”, try to scroll up and then repeatedly try to scroll down; pause for a moment, then scroll down and back up (past the top). Pause again and repeat the scroll up and then down repeatedly motion. |
Not seeing it on my iPhone X: https://streamable.com/fb7me. In any event, I'm happy to leave this issue open for you or others to further pursue what's happening, but I'm not going to pursue this further at the moment. |
You didn’t pause at the top before scrolling up so the event never fired. |
Hey @tiaon, I work at Figma and I'm experiencing the same issue described by @coreyward. It's happening to me on an iPhoneX and iPhone8 on Safari |
the problem is back with iOS 12.2 Beta, but maybe it will be fixed by Apple.. |
Using Gatsby v2, this library is causing an issue with scrolling in a container on iOS Safari in a particular situation.
This is a fairly basic navigation overlay with scrolling content. Assuming the child elements are long enough, this should scroll up and down while the
<body>
remains fixed.It works generally, but if I'm at the top of the
.nav
element and try to scroll up further (swiping down, which would normally give you a peak above the document w/ the springboard animation), the page doesn't scroll at all and scrolling down (swiping up) immediately after is similarly “frozen”. After ~1s with no interaction the behavior resets and scrolling down (swiping up) works again. The same behavior occurs when at the bottom of the.nav
container, only in reverse: scrolling down further (swiping up) causes the freeze.I checked out the timeline to observe and found that this method is getting called excessively during the periods where behavior is “frozen”, but not at all otherwise:
scroll-behavior/src/index.js
Lines 146 to 167 in 4f6f2a5
I suspect that this is somewhat expensive, and deferring the action using
requestAnimationFrame
is amplifying the problem, locking the main thread. I'm not sure what the intent is for this code, and as such, I'm not sure the best course of action to mitigate the issue.The text was updated successfully, but these errors were encountered: