material-components-android
material-components-android copied to clipboard
[BottomSheetBehavior] Fix issue with nested scrolling child views
Fixes #3377
Root cause BottomSheetBehavior stores the reference of the nestedScrollingChild view but it only sets this reference during the layout pass. When this nested scrolling child view is inside another scrollable view and the scroll position changes, the BottomSheetBehavior doesn't see this change and it compares if the touched point is inside the nestedScrollingChild with the old view reference. This results in touch events not propagating to the descendent views.
How PR fixes it Instead of setting nested scrolling child reference in the layout pass, I changed to set it during the touch-down event. Additionally, it will be checked if the touch-down point is inside the nested scrolling child view.
Would this also resolve #2885? They seem like very similar classes of issues.
@OxygenCobalt This fix does not resolve your issue. You only have to get the coordinator layout of the nested bottom sheet and set isNestedScrollingEnabled to true.