Merged
Conversation
stagg
commented
Mar 18, 2025
| public val topRecord: R? | ||
|
|
||
| /** The bottom-most record in the [BackStack], or `null` if the [BackStack] is empty. */ | ||
| public val rootRecord: R? |
Collaborator
Author
There was a problem hiding this comment.
Added this to help check the current root screen without having to iterate the whole back stack.
ZacSweers
approved these changes
Mar 19, 2025
|
great stuff! |
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Mar 19, 2025
Follow up to #1995 Adds a sample app for bottom bar style navigation that is reliant on `resetRoot`, with a corresponding test. ### Demo https://github.com/user-attachments/assets/0d20bc30-b256-413d-b449-4a80b97bf7e8
Contributor
|
I tested my app with the 0.28.0 snapshots and this seems to have resolved my issue, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤞🏻 this fixes #1285
Underlying issue was caused by a new
MovableContentgetting created for a backstack entry that was still in the composition due to animations. The new movable content is effectively the same as the old one, same composite keys etc, so any keyedReusableContentwould get reused without being disposed. This was causing the check inSaveableStateHolderImplto be replayed in newonRememberedcall on the same reused instance.Fix is to fully track the movable content being used, and remove it from our provider reuse map when it is no longer going to be used. Allowing the content to be correctly reparented.
See #2001 for a sample app an test for this