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

[BottomSheetBehavior] Scrolling within a ViewPager2

Open
#2,112 3 comments 0 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:** Full description of issue here

I have a ViewPager2 setup with multiple fragments, in one of them I have a persistent bottom sheet.

I'm having an issue whenever I try and drag the bottom sheet, and the parent viewpager will intercept the gesture, interrupting the bottom sheet drag whenever there is any horizontal movement in the gesture.

https://user-images.githubusercontent.com/17648579/110108809-8a19fe80-7da4-11eb-9ca4-a0f78e0758b2.mp4

**Expected behavior:**

When dragging the bottom sheet, regardless of direction, ViewPager (or any other parents) can't intercept it. Similar behavior to RecyclerView

**Android API version:**
29

**Material Library version:**
Tried both 1.3.0 and 1.4.0-alpha01

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 by reproducing the reported drag in the ViewPager2 setup with a persistent BottomSheetBehavior, using the linked video and the stated Android API and Material Library versions as context. Trace how horizontal gesture interception interrupts the bottom-sheet drag, then verify that ViewPager2 or another parent no longer intercepts the gesture in any direction, matching the expected RecyclerView-like behavior.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.