Open FM1973 opened 1 year ago
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
Any news on this one?
Verified this on Visual Studio Enterprise 17.7.0 Preview 1.0. Repro on Android 13.0-API33 with below Project: RefreshGridRepo.zip
Follow the repro steps, repro on the second time.
I've found a similar problem to the navigation one expressed in the first part of this issue. When you navigate to sub pages from a main menu item in the shell, then change to a different main menu item and back to the first one, the subpage will still be there. The navigation stack doesn't get cleaned when you navigate to another main menu item of the shell.
I'm using VS 17.8.0, Net 8.0 and Net MAUI 8.0.3
The work around I'm temporarily using is to override the OnNavigating method of the Shell as follows:
protected async override void OnNavigating(ShellNavigatingEventArgs args)
{
base.OnNavigating(args);
if (args.Source.Equals(ShellNavigationSource.ShellItemChanged))
{
var token = args.GetDeferral();
if (Shell.Current?.Navigation?.NavigationStack?.Count > 1)
{
await Shell.Current.Navigation.PopToRootAsync(false);
}
token?.Complete();
}
}
This way, only when it's a ShellItemChanged (user selecting some menu item from the shell), I'm checking if there are some other subpages loaded in the stack and then I popToRoot before completing the navigation to the new main menu option.
Just in case it helps others with a similar problem.
Description
According to the docs, when using an absolute navigation, the navigationstack should be cleared. i.e. await Shell.Current.GoToAsync($"//{nameof(MainPage1)}", true);
When I navigate to a page (Page4) which contains a button which opens a "subpage" using relative navigation, then navigate from there to another page (i.e. Page1) using absolute navigation and from there go back to the page containing the subpage (Page4) you can see the previously loaded subpage and then an animation back to the "parent" page.
I know this sounds complicated, but you can try this in the sample repo.
Sometimes, when you switch between those pages, one navigation button gets disabled without any reason.
Steps to Reproduce
To get the random "disable behavior" click on Main 4 and Sub page 1 then 2 and then click on any of the other bottom buttons (not main 4), then click "Main 4" and one of the others again. Sometimes Main 4 gets disabled. If this doesn´t happen, just try again, click on Main 4 and the sub buttons and again on any other bottom button then on Main 4. You may have to do it a couple of times. Sorry, as I stated, this is very random.
Link to public reproduction project repository
https://github.com/FM1973/RefreshGridRepo.git
Version with bug
7.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 11 and up
Did you find any workaround?
No workaround for the not cleared stack. To prevent the strange disable behavior one can use PopToRootAsync before navigating, if the stack contains more than one element.
Relevant log output
No response