Replies: 3 comments 1 reply
-
I understand the scenario -- you've described it well. Can you post a minimal repro using pop() + push()? I'm curious what UX you're getting in that case. |
Beta Was this translation helpful? Give feedback.
-
Hi @csells Just a follow up, in #193 , you mentioned the following:
I'm just wondering if this is planned anytime in the near future? Thank you |
Beta Was this translation helpful? Give feedback.
-
I've been noodling on it but haven't written any code yet. Stay tuned. |
Beta Was this translation helpful? Give feedback.
-
Use Case:
Assume we've a page with nested navigation that can be pushed on top of the stack from anywhere in the app.
Taking Twitter Profile page as an example, the user can navigate to any user profile from anywhere in the app such as:
If the user clicks on the
likes
tab of the profile, the stack would become:Issue:
Let's continue the same the same example with
go_router
and assume/username
is a sub-route to/home
.If the user clicks on a tab to change the nested navigation from
likes
tomedia
, there are two options:context.go('/username/media')
will reset the stack in the following manner (undesirable):context.push('/username/media')
will expand the stack in the following manner (also undesirable) :The undesirable problem with
context.push
is that the back button of theAppBar
will take the user back again to the profile. In addition, pushing the page is not UI friendly (video). I tried combiningpop
andpush
but the switch in UI was very obvious (same as push only) and could lead to state loss.Screen.Recording.2021-11-23.at.7.50.44.PM.mov
Discussion:
Looking at the public API of
go_router
, I could not find a way to replace the last page of the stack without the aforementioned effects.Is this possible and can it be supported?
Beta Was this translation helpful? Give feedback.
All reactions