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

A Bug with the Android Back Button in 9.x.x versions #27896

Open
abdelrahman-ali-intact opened this issue Feb 19, 2025 · 2 comments
Open

A Bug with the Android Back Button in 9.x.x versions #27896

abdelrahman-ali-intact opened this issue Feb 19, 2025 · 2 comments
Labels
area-navigation NavigationPage i/regression This issue described a confirmed regression on a currently supported version platform/android 🤖 regressed-in-9.0.0 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working

Comments

@abdelrahman-ali-intact
Copy link

abdelrahman-ali-intact commented Feb 19, 2025

Description

The back button in Android doesn't trigger DispatchKeyEvent or even the OnBackPressedDispatcher if it registers a callback.

Steps to Reproduce

  1. Add latest Microsoft.Maui.Controls package (9.x.x) to a new Maui Blazor project targets .net9
  2. Add a new Maui page
  3. Add a logic to navigate to that page
 await App.Current.Windows[0].Navigation.PushModalAsync(new NewPage1());
  1. Override the DispatchKeyEvent in the MainActivity to capture the back button for example

Link to public reproduction project repository

https://github.com/abdelrahman-ali-intact/MacrosoftMauiControls9040_Test.git

Version with bug

9.0.40 SR4

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.100 SR10

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

No

Relevant log output

@abdelrahman-ali-intact abdelrahman-ali-intact added the t/bug Something isn't working label Feb 19, 2025
@rmarinho rmarinho added this to the .NET 9 Servicing milestone Feb 19, 2025
@RoiChen001 RoiChen001 added s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage labels Feb 20, 2025
@RoiChen001
Copy link

I can repro this issue at Android platform on the latest 17.14 Preview 1(9.0.40 & 9.0.10 & 9.0.0), but it used to work in 8.0.100.
8.0.100:
Image
9.0.40 & 9.0.10 & 9.0.0:
Image

@RoiChen001 RoiChen001 added i/regression This issue described a confirmed regression on a currently supported version regressed-in-9.0.0 and removed regressed-in-9.0.10 labels Feb 20, 2025
@moljac
Copy link
Contributor

moljac commented Feb 20, 2025

I was able to reproduce.

Repro sample with net8.0 and net9.0 attached

repro-sample.zip

Possibly related:

#24557

@rmarinho rmarinho added the area-navigation NavigationPage label Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-navigation NavigationPage i/regression This issue described a confirmed regression on a currently supported version platform/android 🤖 regressed-in-9.0.0 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants