Skip to content

Commit

Permalink
Fix clearBackStack() from a bottom sheet dialog fragment
Browse files Browse the repository at this point in the history
  • Loading branch information
jayohms committed Feb 24, 2024
1 parent 6ab923c commit efd1956
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions turbo/src/main/kotlin/dev/hotwire/turbo/nav/TurboNavigator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ internal class TurboNavigator(private val navDestination: TurboNavDestination) {
}

onNavigationVisit {
if (fragment is DialogFragment) {
fragment.requireDialog().cancel()
}

val controller = currentController()
controller.popBackStack(controller.graph.startDestinationId, false)
onCleared()
Expand Down

0 comments on commit efd1956

Please sign in to comment.