Skip to content
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

100ms delay between pointermove events in Android webviews? #662

Open
2 tasks done
Linksku opened this issue Apr 10, 2024 · 1 comment
Open
2 tasks done

100ms delay between pointermove events in Android webviews? #662

Linksku opened this issue Apr 10, 2024 · 1 comment
Assignees

Comments

@Linksku
Copy link

Linksku commented Apr 10, 2024

Describe the bug
I noticed that gestures in Android webviews felt laggy, so after some debugging, I found the root cause: pointermove events have a ~100ms delay between them whereas it should be a ~17ms delay. This isn't directly caused by @use-gesture, but it probably affects a lot of @use-gesture users, so just bringing attention to the issue.

In Android Chrome, when starting a drag gesture, the timeline looks something like:

0ms: pointerdown
3ms: pointermove
10ms: pointermove
27ms: pointermove
44ms: pointermove

chrome

In Android webviews, it's something like:

0ms: pointerdown
3ms: pointermove
100ms: pointermove
117ms: pointermove
134ms: pointermove

webview

In each screenshot, I hovered over the first pointermove, then each subsequent pointermove are yellow blocks.

Here's a Codesandbox demo to test the delay: https://codesandbox.io/p/sandbox/clever-shape-8ppngt?file=%2Findex.html%3A1%2C1-17%2C10. You can send the link to yourself via Messenger, which opens it in a webview. I'm getting up to 110ms delay within the Messenger webview (avg around 50ms), and consistently 16-17ms within a browser.

Is this an issue the team is aware of? Is there a possible fix using JS/CSS or do we need to hope the Android folks fix it?

Information:

  • Use Gesture version: v10.3.1
  • Device: Pixel 8
  • OS: Android 14
  • Browser: Android webview

Checklist:

  • I've read the documentation.
  • If this is an issue with drag, I've tried setting touch-action: none to the draggable element.
@Linksku
Copy link
Author

Linksku commented Apr 16, 2024

Chromium team is triaging this: https://issues.chromium.org/issues/333624618

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants