Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] Navigation to a route relatively currently doesn't work with Shell #6096

Open
Hasanajouz opened this issue May 5, 2019 · 7 comments
Open
Labels
a/shell 🐚 e/4 🕓 4 help wanted We welcome community contributions to any issue, but these might be a good place to start! t/bug 🐛 up-for-grabs We welcome community contributions to any issue, but these might be a good place to start!

Comments

@Hasanajouz
Copy link

Hasanajouz commented May 5, 2019

Description

Steps to Reproduce

  1. create two flyout items for example as i created:

<FlyoutItem Route="WelcomeFlyout"> <ShellContent Route="Welcome" ContentTemplate="{DataTemplate page:WelcomePage}" /> </FlyoutItem> <FlyoutItem Route="RegisterFlyout"> <ShellContent Route="Register" ContentTemplate="{DataTemplate page:RegisterPage}" /> </FlyoutItem>
2. from first shellcontent page try to:
Shell.Current.GoToAsync("Register",false); it will give Timeout exceeded exception in main,cs

Expected Behavior

as it was in all pre-releases<10 it should navigate to the register page

Actual Behavior

exception

Basic Information

  • Version with issue: pre 10
    Last known good version: pre 9
  • IDE: vs2019 for windows
  • It happenes for both:
    • iOS
    • Android
@Hasanajouz Hasanajouz added s/unverified New report that has yet to be verified t/bug 🐛 labels May 5, 2019
@PureWeen
Copy link
Contributor

PureWeen commented May 5, 2019

@Hasanajouz I wasn't able to trigger this with a timeout exception. Currently we don't support relative routing to other routes because shell doesn't currently support a navigation stack for routes.

If you change the navigation to

Shell.Current.GoToAsync("Register",false); 

does that work?

@Hasanajouz
Copy link
Author

Shell.Current.GoToAsync("Register",false); is exactly what i tried.

I used to route between other routes without navigation.
so If i have two flyout itmes and i want to go to one of them from the other flyout what should i do now?

while Shell.Current.GoToAsync("Register",false); used to work in pre 9

@PureWeen
Copy link
Contributor

PureWeen commented May 5, 2019

@Hasanajouz wait I copy and pasted the wrong sample apologies

Can you try

Shell.Current.GoToAsync("//Register",false); 

@Hasanajouz
Copy link
Author

@PureWeen yes that worked
Thanks so much.
If you can just give me a link to know where should I use // or / or nothing?

@PureWeen
Copy link
Contributor

PureWeen commented May 5, 2019

@Hasanajouz Awesome!!
Here's the initial spec for how that all works

#5790

We're still getting the behavior for pushing routes on to the stack all finished though. The syntax you initially have will work in upcoming versions

@PureWeen PureWeen added a/shell 🐚 and removed s/unverified New report that has yet to be verified labels May 5, 2019
@PureWeen PureWeen self-assigned this May 5, 2019
@PureWeen PureWeen changed the title [Bug] Timeout exceeded exception - Shell.Current.GoToAsync on pre 10 [Bug] Navigation to a route relatively currently doesn't not work with Shell May 5, 2019
@PureWeen PureWeen changed the title [Bug] Navigation to a route relatively currently doesn't not work with Shell [Bug] Navigation to a route relatively currently doesn't work with Shell May 5, 2019
@samhouts samhouts added the e/4 🕓 4 label May 7, 2019
@dlakes-hx
Copy link

Given the 4.2 RC releases, can we expect this as part of 4.3+?

@dlakes-hx
Copy link

Follow up question @PureWeen -- since routes aren't pushed on to the stack at this time, what is the suggested approach for back button behavior? Do Shell apps need to maintain their own internal queue by hooking in to Shell.OnNavigated that can be popped as needed?

Currently in our application when attempting to invoke default back button behavior, the application crashes. I'm fairly certain all of the routes are being correctly defined (mix of Xaml and RegisterRoute), and invoked via GoToAsync or visual navigation. All of the documentation, ex: here, seems to suggest default back behavior just works. However, some of the comments in doc issues, ex MicrosoftDocs/xamarin-docs#1401, suggest that's not necessarily the case.

At this point, I'm unclear if this is an issue with our application, an issue with documentation, a framework issue, or some mix of the three.

@samhouts samhouts added inactive Issue is older than 6 months and needs to be retested help wanted We welcome community contributions to any issue, but these might be a good place to start! up-for-grabs We welcome community contributions to any issue, but these might be a good place to start! and removed inactive Issue is older than 6 months and needs to be retested help wanted We welcome community contributions to any issue, but these might be a good place to start! labels Jul 17, 2020
@samhouts samhouts added this to the 5.0.0 milestone Aug 13, 2020
@samhouts samhouts added the inactive Issue is older than 6 months and needs to be retested label Sep 18, 2020
@samhouts samhouts added help wanted We welcome community contributions to any issue, but these might be a good place to start! and removed inactive Issue is older than 6 months and needs to be retested labels Sep 18, 2020
@samhouts samhouts removed this from the 5.0.0 milestone Nov 2, 2020
@PureWeen PureWeen removed their assignment Aug 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/shell 🐚 e/4 🕓 4 help wanted We welcome community contributions to any issue, but these might be a good place to start! t/bug 🐛 up-for-grabs We welcome community contributions to any issue, but these might be a good place to start!
Projects
None yet
Development

No branches or pull requests

4 participants