Animate ModalBottomSheet hide on composition removal#880
Open
g000sha256 wants to merge 1 commit into
Open
Conversation
4b29b4f to
6b9fade
Compare
6b9fade to
9517a01
Compare
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.
Proposed Changes
When
ModalBottomSheetis removed from the composition hierarchy, its underlying dialog window is dismissed immediately, and the sheet disappears abruptly, without playing the exit animation.This is particularly noticeable with Navigation 3, where
ModalBottomSheetis hosted as a separate scene and may be removed by navigation stack changes rather than by user dismissal. In this case, the sheet vanishes instantly rather than sliding out smoothly.This change defers dismissal of the dialog window until the sheet has finished animating to
Hidden. Internally,ModalBottomSheetDialoggains a newanimateToHiddensuspend hook thatModalBottomSheetwires tosheetState.hide(). On composition removal, the dialog waits for a one-shot signal, runs the exit animation inside the dialog's own composition, and only then dismisses the window and disposes the composition. The closing behavior now matches that of an explicitonDismissRequest.