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] Android back button doesnt work on .NET MAUI blazor app #2835

Closed
markosteger opened this issue Oct 5, 2021 · 5 comments
Closed

[Bug] Android back button doesnt work on .NET MAUI blazor app #2835

markosteger opened this issue Oct 5, 2021 · 5 comments
Assignees
Labels
area-blazor Blazor Hybrid / Desktop, BlazorWebView platform/android 🤖 t/bug Something isn't working

Comments

@markosteger
Copy link

Description

i have created default .net maui blazor app and deployed it to my old Galaxy s6 running android 7. App works fine, but i simply can’t figure out how to make the device’s back button work.

Example: if i go to ‘Counter’ page it takes me to the page, but back button doesn’t take me back to where i started.

Or.. if i just open the app, back button doesnt close the app as i would expect.

Tried this only on Android 7 so i don't know if this also happens on other platforms or android versions.

Steps to Reproduce

  1. Create new MAUI Blazor app
  2. Build&Deploy
  3. Go to page "Counter" generated by template
  4. Pres back button

Expected Behavior

If we opened a 'Counter' page for example, the app should go one step back, otherwise App should exit

Actual Behavior

Nothing happens

Basic Information

  • Version with issue:
  • Last known good version: /
  • IDE: Visaul Studio Comunnity 2022 Preview (17.0.0.0 Preview 4.1)
  • Platform Target Frameworks: .NET 6 RC1
    • Android: 7 -->
  • Nuget Packages:
  • Affected Devices: Samsung Galaxy S6

Screenshots

Reproduction Link

Workaround

@markosteger markosteger changed the title [Bug] [Bug] Android back button doesnt work on .NET MAUI blazor app Oct 5, 2021
@jsuarezruiz jsuarezruiz added platform/android 🤖 t/bug Something isn't working labels Oct 5, 2021
@Eilon Eilon added the area-blazor Blazor Hybrid / Desktop, BlazorWebView label Oct 5, 2021
@peter-mghendi
Copy link

peter-mghendi commented Oct 20, 2021

I'm having this same issue with both MAUI and MAUI Blazor. Back button/gesture does not close the app.

Basic Information

  • Version with issue: MAUI Preview 8
  • Last known good version: N/A
  • IDE: Visual Studio Community 2022 Preview (17.0.0 Preview 4.1)
  • Platform Target Frameworks: .NET 6 RC1
  • Android: 11
  • Nuget Packages: N/A
  • Affected Devices: Samsung Galaxy A51

@Seanxwy
Copy link

Seanxwy commented Dec 21, 2021

When will the problem be fixed

@peter-mghendi
Copy link

Can confirm that this is fixed for me in the latest preview (preview 11).

@IIARROWS
Copy link

It's not fixed for me. It works for exiting the app, but not for going back in the page history.

I'm not even sure it's a good idea to allow that by default, the app may want to avoid the user to navigate back, it's not a web page after all. I think it should be controlled, and right now, it's not possible to avoid the navigation without some complex code. That's currently planned for .NET 7: dotnet/aspnetcore#14962

@mkArtakMSFT mkArtakMSFT assigned TanayParikh and unassigned Eilon Feb 16, 2022
@TanayParikh
Copy link
Contributor

Hey all, thanks for commenting!

Exiting the Android app will be handled via #3314.

Navigating the Blazor WebView (this issue) was handled via #4364.

@ghost ghost locked as resolved and limited conversation to collaborators Mar 18, 2022
@mkArtakMSFT mkArtakMSFT added this to the 6.0.300-preview.14 milestone Mar 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Blazor Hybrid / Desktop, BlazorWebView platform/android 🤖 t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants