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

refactor(gesture): use tap to simulate double tap #665

Merged
merged 5 commits into from
Sep 15, 2024

Conversation

ChrisCindy
Copy link
Contributor

In Flutter, if you use GestureDetector to bind both onTap and onDoubleTap events simultaneously, the following situations will occur:

  1. When single-clicking, the onTap event will always be triggered with a 300ms delay;
  2. When double-clicking, only the onDoubleTap event will be triggered.

webf uses TapGestureRecognizer's onTap and DoubleTapGestureRecognizer's onDoubleTap to handle click and dblclick events, respectively, which leads to the same issues mentioned above.

We expect behavior that aligns with web standards:

  1. The bound click event is triggered immediately when a single click occurs.
  2. A double-click event within 300ms triggers two click events and one dblclick event.
    Therefore, in this case, we use TapGestureRecognizer's onTap to handle both click and dblclick events simultaneously.

Closes #648

@andycall andycall merged commit 9834934 into main Sep 15, 2024
26 of 29 checks passed
@andycall andycall deleted the fix/handle-dblclick-event branch September 15, 2024 08:41
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

Successfully merging this pull request may close these issues.

The "onClick" events respond very slowly on the macos desktop
2 participants