Closed shkim closed 2 years ago
Does cancel()
work? If so, I'll update the internal logic so that navigateBack()
and navigateUp()
work properly, since those should be the standard way to go back to the previous screen.
I got the Unresolved reference error with just "cancel()" there.
Sorry, use requireDialog().cancel()
Thanks. it works.
Thanks, I've added a new issue to track fixing the default behavior: https://github.com/hotwired/turbo-android/issues/197
If the presenting dialog is an instance of TurboFragment, I can close the dialog by calling navigateBack() and underlying page works fine.
But if the dialog is an instance of TurboBottomSheetDialogFragment, navigateBack() call will make the underlying page locked. I tried navigateUp(), dismiss() but the result was same. ( If I click the back button or touch the outer dark side of sheet, then everything is working as expected. )
What is the proper way to close the sheet programmatically?
https://user-images.githubusercontent.com/1094548/136361753-cb798877-ddbd-4bf9-a318-7dada971cd72.mov
I prepared the sample code: https://github.com/shkim/turbo-android/commit/00130f2d316995c20abca194675262e4cd2537e8
and here are steps to modify the "demo":
change the configuration.json to popup native sheet when '/numbers' url is requested:
setup click handler for NumberBottomSheetFragment.kt: