dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.86k stars 1.68k forks source link

GestureRecognizers overlaps in a control #22675

Open pictos opened 1 month ago

pictos commented 1 month ago

Description

GestureRecognizers overlaps in a control

If you've a control with more than one GestureRecognizer, the one that needs less taps to be fired will always fire. For example, let's say that you have this xaml

            <Image
                Aspect="AspectFit"
                HeightRequest="185"
                SemanticProperties.Description="dot net bot in a race car number eight"
                Source="dotnet_bot.png">
                <Image.GestureRecognizers>
                    <TapGestureRecognizer Tapped="OnetapGesture" />
                    <TapGestureRecognizer NumberOfTapsRequired="2" Tapped="TwotapGesture" />
                </Image.GestureRecognizers>
            </Image>

the OnetapGesture will always fire, even if I perform a two tap gesture.

Steps to Reproduce

  1. Run the attached sample
  2. Tap one or two times on the image
  3. See the labels counting the number of times that each GestureRecognizer was fired

Link to public reproduction project repository

https://github.com/pictos/TapGestureIssue

Version with bug

8.0.21 SR4.1

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android, Windows, macOS

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

github-actions[bot] commented 1 month ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

ninachen03 commented 1 month ago

Verified this issue with Visual Studio 17.11.0 Preview 1.0 ( 8.0.40 & 8.0.21& 8.0.3 ) Can repro it.