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

[BUG] AnimationBehavior remove TapGestureRecognizer #2489

Open
2 tasks done
IeuanWalker opened this issue Feb 4, 2025 · 0 comments
Open
2 tasks done

[BUG] AnimationBehavior remove TapGestureRecognizer #2489

IeuanWalker opened this issue Feb 4, 2025 · 0 comments
Labels
bug Something isn't working unverified

Comments

@IeuanWalker
Copy link
Contributor

IeuanWalker commented Feb 4, 2025

Is there an existing issue for this?

  • I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

Current Behavior

I have quite a simple animation that rings the notification bell if a new notification comes in -
https://github.com/user-attachments/assets/21a09e58-6417-4437-9f3d-76c7d8ac4383

That works by just calling the AnimateCommand as documented here - https://learn.microsoft.com/en-us/dotnet/communitytoolkit/maui/behaviors/animation-behavior#programmatically-triggering-the-animation

My issue is randomly pressing the notification button triggers the animation, and for it not too open up the notification list as it should be.

Looking at the code, it adds a TapGestureRecognizer to the control unless its triggered by an event - https://github.com/CommunityToolkit/Maui/blob/d8cf48db2900835dac424f1d7245708295c516fc/src/CommunityToolkit.Maui/Behaviors/AnimationBehavior.shared.cs#L87C3-L90C67

That TapGestureRecognizer then triggers the animation - https://github.com/CommunityToolkit/Maui/blob/d8cf48db2900835dac424f1d7245708295c516fc/src/CommunityToolkit.Maui/Behaviors/AnimationBehavior.shared.cs#L108C3-L108C43

How do I remove the TapGestureRecognizer when triggering it via AnimateCommand?

Expected Behavior

For there to be no TapGestureRecognizer added

Steps To Reproduce

See above

Link to public reproduction project repository

n/a

Environment

- .NET MAUI CommunityToolkit: 10.0.0
- OS: More of an issue on iOS
- .NET MAUI: Latest

Anything else?

No response

@IeuanWalker IeuanWalker added bug Something isn't working unverified labels Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unverified
Projects
None yet
Development

No branches or pull requests

1 participant