When I try to scroll list, sometimes this works incorrect - BottomSheet intercepts the scroll event and hides.
How to reproduce this:
Looks like all that's required is updating nestedScrollingChildRef appropriately.
Simply setting it to the target parameter in onStartNestedScroll is working for me:
package com.google.android.material.bottomsheet
class ViewPagerBottomSheetBehavior(context: Context, attrs: AttributeSet?) : BottomSheetBehavior(context, attrs) {
override fun onStartNestedScroll(coordinatorLayout: CoordinatorLayout, child: V, directTargetChild: View, target: View, axes: Int, type: Int): Boolean {
nestedScrollingChildRef = WeakReference(target)
return super.onStartNestedScroll(coordinatorLayout, child, directTargetChild, target, axes, type)
}
}