-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Description
I have a problem with the double tap gesture. If it triggers navigation, I get a NullReferenceException

The error doesn't show if I use a different gesture (swipe).
I'm using this trick in navigation because there is no reason to return to a page with GestureRecognizers (FirstPage), I always want to return to MainPage.
The problem exists only on Android (I'm using Samsung A52s with Android 13). When I was trying to run it on Windows, I couldn't reproduce the error. Also, this problem appeared when I migrated to .NET 8, on NET 7 it works correctly.
Steps to Reproduce
<VerticalStackLayout.GestureRecognizers>
<TapGestureRecognizer NumberOfTapsRequired="2" Tapped="OnGesture" />
<SwipeGestureRecognizer Direction="Up,Down,Left,Right" Swiped="OnGesture" />
</VerticalStackLayout.GestureRecognizers>
private async void OnGesture(object sender, EventArgs e)
{
Navigation.InsertPageBefore(new SecondPage(), this);
await Navigation.PopAsync(animated: false);
}
Link to public reproduction project repository
https://github.com/konrad-gora/DoubleTapError
Version with bug
8.0.3
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 13 Samsung A52s
Did you find any workaround?
Adding Delay makes it work.
await Navigation.PushAsync(new SecondPage(), animated: false);
await Task.Delay(1);
Navigation.RemovePage(this);
Also if I'm not removing this page from navigation, there is no error (but this is not an expected behavior).
Relevant log output
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status