How could I prevent scroll gestures from a `LazyCo...
# compose
j
How could I prevent scroll gestures from a
LazyColumn
inside a bottom sheet from dismissing the sheet? is it possible to disable the sheet swipe gestures within a certain boundary? (in my case I want to disable them over the
LazyColumn
)
m
@Ian Lake Is there a way to achieve this? I am facing similar issue
Copy code
val bottomSheetScaffoldState =
    rememberModalBottomSheetState(ModalBottomSheetValue.Hidden, confirmStateChange = {
        it != ModalBottomSheetValue.Hidden
    })
This way the sheet won’t be dismissed but it still changes position which I don’t want,
j
This is an old question, you could do something like this to disable nested scroll:
Copy code
Modifier.nestedScroll(remember {
    object : NestedScrollConnection {
        override fun onPostScroll(
            consumed: Offset,
            available: Offset,
            source: NestedScrollSource
        ) = available

        override suspend fun onPostFling(
            consumed: Velocity,
            available: Velocity,
        ) = available
    }
})
👍 1
m
Thanks, It works.