material-components / material-components/material-components-android

[BottomSheetBehavior] Nested scrolling child view does not scroll when its inside nested scrolling parent

Open
#3,377 0 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Widget: BottomSheet
Dominant language
Java
Stars
17.4k
Forks
3.2k
PR merge metrics
No merged PRs in 30d

Description

**Description:** When a nested scrolling child view is inside a nested scrolling parent view and the child view changes the scroll position, the touch events get intercepted by the bottom sheet behavior. For example, if I put a ViewPager2 in the bottom sheet dialog and put a vertically scrollable RecyclerView inside the ViewPager2, and navigate to the second page, the RecyclerView becomes unscrollable.

**Expected behavior:** Nested scrolling child view must be scrollable and should not be intercepted by bottom sheet behavior.

**Minimal sample app repro:** https://github.com/UdaraWanasinghe/bottom-sheet-nested-scrolling-test

**Android API version:** All affected.

**Material Library version:** 1.8.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked minimal sample app and reproduce the issue using a ViewPager2 containing a vertically scrollable RecyclerView inside a bottom sheet. Then trace BottomSheetBehavior's handling of nested scrolling and touch interception; done means the RecyclerView remains scrollable after navigating to the second page on the affected Material Library version.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.