Skip to content

Commit

Permalink
review: Add safeCurrentContent() kDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinBoulongne committed Nov 7, 2024
1 parent 884368f commit b1ae78c
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ fun <T> TwoPaneScaffold(
)
}

/**
* Keep the DetailPane's content in memory so that it's always available while navigating back.
* When leaving the DetailPane, its content becomes `null`, which creates a visual glitch in the back animation.
*/
@OptIn(ExperimentalMaterial3AdaptiveApi::class)
@Composable
fun <T> ThreePaneScaffoldNavigator<T>.safeCurrentContent(): T? {
Expand Down

0 comments on commit b1ae78c

Please sign in to comment.