ModalBottomSheetLayout flashes on back navigation (Jetpack Compose)

207 Views Asked by At

I'm using ModalBottomSheetLayout (import androidx.compose.material.ModalBottomSheetLayout) and have some items in a modal sheet layout and when I press on an Item, it navigates to next screen. However, when I press back button on the second screen, the modal sheet reappears with a flashing behavior. I think this is because of recomposition or UI is getting redrawn but I want to avoid this flashing behaviour, on back navigation the modal should be in the opened state but it shouldn't look like as if it is opening again from bottom (causing flashing behaviour). How can I fix this

I'm using sheetState inside modal using rememberModalBottomSheetState

0

There are 0 best solutions below