Skip to content

[Question] ModalBottomSheet invokes onDismissRequest multiple times during exit animation, causing duplicate onBack calls #289

Description

@Frivan777

This issue is observed when using the BottomSheet recipe from:
https://github.com/android/nav3-recipes/tree/main/app/src/main/java/com/example/nav3recipes/bottomsheet

The onBack callback is invoked multiple times because onDismissRequest fires repeatedly if the screen is tapped rapidly during the slide-down exit animation.

The sheet and its scrim remain interactive during the ~300ms animation window. In a state-driven architecture like Navigation 3, receiving multiple dismiss events for a single close action causes severe side effects, such as double-popping the navigation stack.

Steps to Reproduce
Implement the Bottom Sheet recipe from nav3-recipes.

Open the sheet and tap outside to dismiss it.

Rapidly spam tap the screen while the sheet is animating down.

Expected Result
onDismissRequest (and consequently onBack) should be called exactly once per dismiss cycle.

Actual Result
onDismissRequest is triggered multiple times during the animation window:

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionA question about how to use Nav3

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions