Skip to content

ContentPage's OnBackButtonPressed not invoked on iOS and MacCatalyst #8296

@MSicc

Description

@MSicc

Description

The ContentPage's OnBackuButtonPressed method is not invoked on iOS and MacCatalyst.

Seems to work on other Platforms (only tested Android in the simulator).

Steps to Reproduce

  1. Create new MauiApp
  2. Add a second Page
  3. Replace AppShell call with
    MainPage = new NavigationPage(new MainPage());
  4. Add a button and add code to navigate to the second Page
    async void NavigateButton_Clicked(System.Object sender, System.EventArgs e) { await this.Navigation.PushAsync(new NewPage1()); }
  5. On the second page, override OnBackButtonPressed():
    protected override bool OnBackButtonPressed() { return base.OnBackButtonPressed(); }
  6. Set a breakpoint
  7. Debug the app, go to the second page, hit the back button - should break in there, but doesn't

Version with bug

6.0.312

Last version that worked well

Unknown/Other

Affected platforms

iOS, macOS

Affected platform versions

iOS15, MacOS 12.4

Did you find any workaround?

not yet, will update once I found one...

Relevant log output

-

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions