dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.21k stars 1.75k forks source link

[iOS] Using long-press navigation on back button using shell does not update the shell's current page #23892

Open Vetle444 opened 3 months ago

Vetle444 commented 3 months ago

Description

First of all, thank you for the amazing framework you have built!

We are struggling with using the long-press navigation on the back button, here is what happens: If one is using Shell and the NavigationStack is >1, you get a back button where you can long-press on it to show all the pages that is in the NavigationStack (except for the page you are at of course). If you select a page to navigate back to, the Shell's CurrentPage is not getting updated. This is causing problems in our published app.

image

Steps to Reproduce

  1. Use the standard .NET MAUI sample.
  2. Create a new ContentPage (TestPage.cs).
  3. Create a button to navigate to it: _ = Shell.Current.Navigation.PushAsync(new TestPage());.
  4. Tap and hold on the back button and release to navigate back.
  5. Set a breakpoint in the page you navigated back to, for instance in OnAppearing.
  6. Observe that the Shell.Current.CurrentPage property is still set to the page you navigated to before.

Link to public reproduction project repository

No response

Version with bug

8.0.70 SR7

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

All iOS versions

Did you find any workaround?

No. I don't think there is any workaround to be found for this. One could possibly be able to disable the feature though.

Relevant log output

No response

github-actions[bot] commented 3 months ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

mattleibow commented 3 months ago

@PureWeen thoughts?

Vetle444 commented 3 months ago

Also, another issue here is that we are relying on Shell's Navigated and Navigating events, and those aren't firing when using long-press.

AndrewFrancisSE commented 2 months ago

I am having the same problem, please let me know if anyone has solved this problem.