Dragging gesture is consumed when used in scrollable composable

Open
#818 5 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Start by reproducing the issue with the linked minimal ComposePhotoView repository, focusing on Column with Modifier.verticalScroll and AndroidView wrapping PhotoView. Compare the dragging behavior with the referenced Compose issue and the expected Views behavior. Done means dragging on PhotoView allows the surrounding scrollable composable to scroll.

Written by the indexing model from the issue text.

Description

🐛 Bug Report

When the PhotoView is used in a scrollable composable, the PhotoView and Compose don't communicate the dragging events properly, and so the composable doesn't scroll as it should. When dragging some other part of the composable, scrolling works.

TBH, this sounds like a Compose issue, so I also made a ticket for them: https://issuetracker.google.com/issues/220919265

Expected behavior

When dragging on PhotoView which is in scrollable composable, the composable can be scrolled.

Reproduction steps

You can checkout this minimal repo.

The problem lies in this:

Column(modifier = Modifier.verticalScroll(...)) {
     AndroidView(factory = { context -> PhotoView(context) })
}

Also, a video. The problematic Compose behavior starts at 0:16. Before that, you can see the expected behavior in Views.

https://user-images.githubusercontent.com/24211726/155380978-0ea22f31-5557-4940-9a79-94a396ed0696.mp4

Configuration

Version: 2.3.0

Platform: 🤖 Android 11

Dominant language
Java
Stars
18.8k
Forks
3.9k
PR merge metrics
No merged PRs in 30d

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.

More from Baseflow/PhotoView

All issues in Baseflow/PhotoView

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.