[BUG] AnimationBehavior remove TapGestureRecognizer #2489
Labels
area/behaviors
Issue/Discussion/PR that has to do with Behaviors
bug
Something isn't working
unverified
Is there an existing issue for this?
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-animationMy 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-L90C67That
TapGestureRecognizer
then triggers the animation - https://github.com/CommunityToolkit/Maui/blob/d8cf48db2900835dac424f1d7245708295c516fc/src/CommunityToolkit.Maui/Behaviors/AnimationBehavior.shared.cs#L108C3-L108C43How do I remove the
TapGestureRecognizer
when triggering it viaAnimateCommand
?Expected Behavior
For there to be no
TapGestureRecognizer
addedSteps To Reproduce
See above
Link to public reproduction project repository
n/a
Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: