[Bug]: Unintended back navigation occurs when rapidly tapping the back button in topicScreen
#1571
Open
3 tasks done
Labels
bug
Something isn't working
Is there an existing issue for this?
Is there a StackOverflow question about this issue?
What happened?
When rapidly tapping the back button in the
topicScreen
component, unintended back navigation occurs. The current implementation of theonBackClick
directly callslistDetailNavigator.navigateBack()
without first checking if navigation is allowed, leading to unexpected behavior.I expected the back navigation to occur only when it is allowed, preventing any unintended navigation when the back button is tapped multiple times in quick succession. Specifically, the
onBackClick
should checklistDetailNavigator.canNavigateBack()
before callingnavigateBack()
to ensure that the back navigation is permitted.In typical scenarios using a standard
navController
, this issue can be avoided by checking the lifecycle state of thenavBackStackEntry
before popping the back stack:Relevant logcat output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: