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

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

Open
Vetle444 opened this issue Jul 29, 2024 · 5 comments · May be fixed by #24003
Open
Labels
area-navigation NavigationPage migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert platform/iOS 🍎 t/bug Something isn't working
Milestone

Comments

@Vetle444
Copy link

Vetle444 commented Jul 29, 2024

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

@Vetle444 Vetle444 added the t/bug Something isn't working label Jul 29, 2024
Copy link
Contributor

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.

@samhouts samhouts added platform/iOS 🍎 migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert labels Jul 30, 2024
@mattleibow
Copy link
Member

@PureWeen thoughts?

@mattleibow mattleibow added this to the Backlog milestone Jul 30, 2024
@mattleibow mattleibow added the area-navigation NavigationPage label Jul 30, 2024
@Vetle444
Copy link
Author

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
Copy link

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

@Pallav-sculptsoft
Copy link

Pallav-sculptsoft commented Dec 3, 2024

Hello,

I'm also facing the same issue with latest version.

Issue : on iOS when long press on back button and navigating through the menu then not updating shell current page, as well as not notified to OnNavigating and OnNavigated and even did not get callback on OnBackButtonPressed.

Expected : at least it's calls OnBackButtonPressed when user using LongPress back button navigation.
maybe maui enhance it and provide a flag to disable long press back button. ref(#19793)

Here is the system and environment used info :

{
  "sdk": {
    "version": "8.0.0",
    "rollForward": "latestMinor",
    "allowPrerelease": false
  }
}
.NET SDK:
 Version:           8.0.404
 Commit:            7b190310f2
 Workload version:  8.0.400-manifests.1d38e1bd
 MSBuild version:   17.11.9+a69bbaaf5

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  15.1
 OS Platform: Darwin
 RID:         osx-arm64
 Base Path:   /usr/local/share/dotnet/sdk/8.0.404/

.NET workloads installed:
Configured to use loose manifests when installing new manifests.
 [maui]
   Installation Source: SDK 8.0.400
   Manifest Version:    8.0.83/8.0.100
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/8.0.100/microsoft.net.sdk.maui/8.0.83/WorkloadManifest.json
   Install Type:        FileBased


Host:
  Version:      9.0.0
  Architecture: arm64
  Commit:       9d5a6a9aa4

.NET SDKs installed:
  8.0.404 [/usr/local/share/dotnet/sdk]
  9.0.100 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 8.0.11 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 8.0.11 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
--------

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-navigation NavigationPage migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert platform/iOS 🍎 t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants