Hi, what back button behavior would you guys expec...
# compose
l
Hi, what back button behavior would you guys expect with bottom navigation. Would you retain the history or always pop to the root tab? If we have for instance 3 tabs, would you expect A -> B -> C -> A -> B ; pressing back button: A -> C -> B -> A or would you expect A. Material Design doesn't cover this clearly and I read that google apps arent consistent here
g
From a user point of view, I would expect the whole history.
j
The Material Design site used to recommend the "always pop to root" approach but they removed that suggestion. The Compose Navigation page does pop to root but I think it's mostly to keep things simple. Some apps like YouTube keep history (without duplicates) while others like TikTok pop to root. I don't mind either.
a
multiple backstack isn't supported yet in both navigation lib and compose navigation. though there's a workaround im the navigation lib. and I think the support is coming soon.
single backstack cannot retain backstack for each tab
s
If there's some state on the screens I would like to retain then the whole history otherwise A
i
Pop to root is consistently what the UX research we've done shows is the least confusing to users. That's entirely separate from the conversation on whether each tab should save its own state when you reselect it (which is what the multiple back stack work will enable)
1
a
Ah, right, I got confused. We also pop to root in our application
l
Thanks a lot for your time guys. I will go with pop to route, which is also the simpler solution 🙂
r
@Ian Lake but the youtube app has bottom nav items and when clicking back it does not go to home which i assume should be the start destination. If i have to achieve something like what youtube app does in terms of navigation in compose what approach should i take.