-
Notifications
You must be signed in to change notification settings - Fork 605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Navigation Animation] Double clicks launch the destination twice #1320
Comments
I believe this is expected behavior, since clicks that result in two The button is still interactable as it is animating out, so if that button directly causes a One approach to avoid this is to check if the lifecycle of the current destination is no longer resumed, and in that case, drop the event that will cause navigation. An example of that is in Calling |
|
You can use Modifier.combinedClickable and set the onDoubleClick empty; Modifier.combinedClickable( |
Description
When I quickly click twice on a button that launches a navigation, the button receives the click events twice and the navigation triggers twice. I'm not able to reproduce this on the regular compose navigation component library.
If this is the expected behavior, what can I do to prevent it from launching the navigation twice?
Steps to reproduce
I integrated the accompanist anim navigation library in the Rally app from the compose codelab to reproduce. Click twice quickly on the "See all" button from Home. The branch is
end-repro
.Repo: https://github.com/mkano9/android-compose-codelabs/tree/end-repro
Changes I made: https://github.com/mkano9/android-compose-codelabs/compare/end...mkano9:android-compose-codelabs:end-repro?expand=1
Expected behavior
It should not launch the new screen twice.
Additional context
Video:
https://user-images.githubusercontent.com/100639909/188287727-af4945cb-9792-4571-8241-620844a02d5e.mov
The text was updated successfully, but these errors were encountered: