Skip to content

TapGestureRecognizer NumberOfTapsRequired=2 Handled Differently on Windows and Android #16235

@david-maw

Description

@david-maw

Description

If a Label control specifies two TapGestureRecognizer items, on for a single tap, one for a double tap the behavior in Windows and Android differs. If you double tap on the Label in Android it fires the double tap event, but in Windows it fires the tap event twice and then the double tap event.

Steps to Reproduce

  1. Load the git repository and open up the project
  2. Build and run on Android
  3. Double Tap/Click on the "Tap Me" Text
  4. In the output window you should see "[0:] >>> OnDoubleTap Called"
  5. Build and run on Windows
  6. Double Tap/Click on the "Tap Me" Text
  7. In the output window you should see
>>> OnTap Called
>>> OnTap Called
>>> OnDoubleTap Called

Link to public reproduction project repository

https://github.com/david-maw/Bug-MAUI-Taps.git

Version with bug

Unknown/Other

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

Windows 10

Did you find any workaround?

Using Buttons=Secondary instead of NumberOfTapsRequired=2 on Windows worked in my case. It changed the UI slightly but did the job. So you end up with attributes like this:
NumberOfTapsRequired="{OnPlatform Default=2, WinUI=1}" Buttons="Secondary"

Which creates a 'double tap' event that works (if slightly differently) on both Windows and Android

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-gesturesGesture typesplatform/windowss/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions