google / accompanist

A collection of extension libraries for Jetpack Compose
https://google.github.io/accompanist
Apache License 2.0
7.38k stars 596 forks source link

[Navigation Material] Bottom sheet popped when navigating to a non-bottomsheet screen #1647

Closed mkano9 closed 1 year ago

mkano9 commented 1 year ago

Description When navigating from bottom sheet A to bottom sheet B and then pressing the back button, bottom sheet A appears again which is expected. But when navigating from bottom sheet A to a full screen composable A and pressing the back button, bottom sheet A does not appear.

Is this a bug? Also, is there a plan to support this library's functionality in jetpack navigation in the future?

ianhanniballake commented 1 year ago

This is intentional as per the documentation:

[these] destinations implement the FloatingWindow interface, indicating that they overlay other destinations on the back stack. As such, one or more FloatingWindow destinations can be present only on the top of the navigation back stack. Navigating to a destination that does not implement FloatingWindow automatically pops all FloatingWindow destinations off of the top of the stack. This ensures that the current destination is always fully visible above other destinations on the back stack.