google / accompanist

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

[Navigation Material] Ensure Navigation Material properly handles back for nested nav #1736

Closed jbw0033 closed 9 months ago

jbw0033 commented 9 months ago

If there is a nested NavGraph under the current bottomSheet destination and you do a back press, instead of the bottomSheet which is the topmost destination being popped, the nested NavHost underneath will be popped instead. This is caused by bottomSheet not properly intercepting back presses.

This change added a BackHandler to ensure that bottomSheets correctly respect the system back hierarchy for back events.

Fixes: #1726