Skip to content
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

BottomSheet dismiss by tapping outside #691

Open
TheFaithOne opened this issue Oct 15, 2024 · 0 comments
Open

BottomSheet dismiss by tapping outside #691

TheFaithOne opened this issue Oct 15, 2024 · 0 comments

Comments

@TheFaithOne
Copy link

TheFaithOne commented Oct 15, 2024

Hi,
on the latest 1.11.7 version there seems to be some kind of an issue with closing bottom sheets by tapping on the scrim (outside of the content of the bottom sheet). The propagation of destination change to the navController seems to be delayed by quite a long time, especially noticeable if some ui elements are hidden when current destination is FloatingWindow. When closing the bottom sheet via a close button, which calls navigator.popBackStack() or via a system back button/gesture the bottom sheet is closed an the destination change is propagated immediately. I've attached some logging to rememberModalBottomSheetState's confirmValueChange and it's behaving as expected for popping backstack.
2024-10-15 14:45:35.176 15054-15054 ScaffoldKt com.myapp.uat E Expanded
2024-10-15 14:45:37.069 15054-15054 ScaffoldKt com.myapp.uat E Hidden
However, when tapped outside of the bottom sheet what I see in the log is this:
2024-10-15 14:47:42.288 15054-15054 ScaffoldKt com.myapp.uat E Expanded
2024-10-15 14:47:43.285 15054-15054 ScaffoldKt com.myapp.uat E Hidden
2024-10-15 14:47:43.670 15054-15054 ScaffoldKt com.myapp.uat E Hidden
2024-10-15 14:47:43.787 15054-15054 ScaffoldKt com.myapp.uat E Hidden

Only after the third call to confirmValueChange is the backstack updated. This also causes an issue when users tap an action that opens bottom sheet twice with a slight delay, the bottom sheet is "dismissed" but the navigation stack remains the same, meaning I can interact with the rest of the app, but destination change is not reflected in the current destination which is defined as such:
val navBackStackEntry by navController.currentBackStackEntryAsState() val currentDestinationRoute = navBackStackEntry?.destination

If necessary, I could try and reproduce this in a sample project and send you the link to it.
Thanks.
P.S. if you also can test if this issue is also present in the 2.0 version that would be great. I'm willing to do the migration, but the project is quite big and migration itself would involve a lot of work, which I don't want to do right now if it's not going to fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant