Zoltan Demant
09/22/2023, 6:16 AMModalBottomSheet
sticking around a lil too long after being dismissed, and interactions being ignored in the in meantime?ascii
09/22/2023, 6:30 AMZoltan Demant
09/22/2023, 7:55 AMascii
09/22/2023, 8:55 AMonDismissRequest
is called. This lambda would usually have your sheet hiding logic, e.g. setting a state variable to false
.
Tapping on the scrim immediately calls it (only if scrim color isSpecified
); thus content "behind" the sheet can also be interacted with immediately, because sheet is removed from the composition.
Dismissing by pressing back or swiping down plays out an animation first, and then calls onDismissRequest
via invokeOnCompletion
. Coroutines & iOC may have their own overhead that brings out delays. However, I wouldn't say it lasts for 2s; that's way too long. In my case it's a few hundred milliseconds.
See for yourself: https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/[…]kotlin/androidx/compose/material3/ModalBottomSheet.android.ktZoltan Demant
09/22/2023, 9:07 AMThe way it's set up right now is that the bottom sheet window consumes all touch events (?), so it has to be removed from compThis sounds like the underlying issue. Agreed about it not being 2s, however seems to be long enough that my first touch event after dismissing it is ignored almost everytime.
Tapping on the scrim immediately calls it (only if scrim colorIf I understand you correctly, in this case the sheet will simply disappear without any animation?); thus content "behind" the sheet can also be interacted with immediately, because sheet is removed from the composition.isSpecified
ascii
09/22/2023, 9:14 AMonDismissRequest
is set to animateToDismiss
, and that function does the animate + invokeOnCompletion thingZoltan Demant
09/22/2023, 9:27 AMpointerInput
block, basically removing it when the sheet is dismissing or very close to fully hidden?