[FR]: Use navigateUp() Instead of popBackStack() for Toolbar Up Button Click #1817
Open
2 tasks done
Labels
enhancement
New feature or request
Is there an existing issue for this?
Describe the problem
I recently reviewed the principles of navigation in Compose. From what I understand, the top app bar’s “Up” navigation button should call
navController.navigateUp()
rather thanpopBackStack()
, which is intended for handling the device’s back press.However, in the
NiaNavHost
, theonBackClick
callbacks in various screens are currently usingpopBackStack()
. My understanding is thatonBackClick
is hoisted to handle the toolbar’s “Up” button clicks in these screens.The current implementation using
popBackStack()
works as expected. However, I would like to understand whether usingnavigateUp()
might be a more appropriate approach.Describe the solution
Current
Proposed
Additional context
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: