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.06k stars 1.73k forks source link

Back navigation does not work after traversing the first page in a 10 page stack with Shell Navigation #24787

Open SoureMaster opened 1 month ago

SoureMaster commented 1 month ago

Description

I am currently using Shell Navigation on the app I am creating. There is a signup process in which the user must complete. Back arrow does not fire after traversing to the second page of a 10 page stack.

First Page - Landing page Second Page - First page of sign up process (Back arrow works) Third Page to 10th page of sign up, back arrow does not fire and the user is stuck. Image

Steps to Reproduce

No response

Link to public reproduction project repository

MauiNavIssue

Version with bug

9.0.0-rc.1.24453.9

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

9.0.0-preview.7.24407.4

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

github-actions[bot] commented 1 month 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.

tj-devel709 commented 1 month ago

Hi, if you could provide a github link to a repro sample, that would help us in identifying the bug. Thanks!

SoureMaster commented 1 month ago

I have added link to repository. Perhaps being new to Maui I am doing something wrong.

PureWeen commented 4 weeks ago

@SoureMaster This one might be fixed on RC2

Does this issue look similar? https://github.com/dotnet/maui/issues/24555

ninachen03 commented 4 weeks ago

This issue has been verified using Visual Studio 17.12.0 Preview 2.0(9.0.0-rc.1.24453.9 &9.0.0-preview.7.24407.4& 8.0.82 & 8.0.3). 17.11.4 (7.0.101) Can repro this issue with the MauiNavIssue

SoureMaster commented 4 weeks ago

Yes, it does look similiar. @PureWeen

QianaJiao commented 4 weeks ago

Hi @PureWeen @SoureMaster
This might be a little different with https://github.com/dotnet/maui/issues/24555 As for 24787, it does repro on Android and Windows, it is not a regression, and I found a similar issue here: stackoverflow 67653489 OUTPUT: Open Page 2 then Open 3/4/5 pages and click back button:

[0:] Microsoft.Maui.Controls.Shell: Warning: Failed to Navigate Back
System.ArgumentException: Ambiguous routes matched for: //IMPL_PageOne/IMPL_PageOne/PageOne/PageTwo matches found: //IMPL_PageOne/IMPL_PageOne/PageOne/PageTwo,//IMPL_PageOne/IMPL_PageOne/PageOne/PageTwo (Parameter 'uri')
   at Microsoft.Maui.Controls.ShellUriHandler.GetNavigationRequest(Shell shell, Uri uri, Boolean enableRelativeShellRoutes, Boolean throwNavigationErrorAsException, ShellNavigationParameters shellNavigationParameters) in /_/src/Controls/src/Core/Shell/ShellUriHandler.cs:line 207
   at Microsoft.Maui.Controls.ShellNavigationManager.GoToAsync(ShellNavigationParameters shellNavigationParameters, ShellNavigationRequest navigationRequest) in /_/src/Controls/src/Core/Shell/ShellNavigationManager.cs:line 63
   at Microsoft.Maui.Controls.ShellSection.NavigationImpl.OnPopAsync(Boolean animated) in /_/src/Controls/src/Core/Shell/ShellSection.cs:line 1061
   at Microsoft.Maui.Controls.Platform.Compatibility.ShellToolbarTracker.OnNavigateBack() in /_/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellToolbarTracker.cs:line 228

So, I followed the workaround and just deleted "Route=" PageOne ""... then it worked: Animation

SoureMaster commented 4 weeks ago

@QianaJiao Thanks, that Stack overflow info and your code solved the issue. Thanks again.