Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On iOS platforms, Compose gestures(scroll or drag) conflict with native gestures. #5026

Open
Gaubee opened this issue Jun 25, 2024 · 2 comments
Assignees

Comments

@Gaubee
Copy link

Gaubee commented Jun 25, 2024

Describe the bug
The gestures discussed here include scrolling and dragging. I haven't tested in other scenarios yet.

Regarding dragging: I implemented a native listener (using addGestureRecognizer attached to a UIView, which is rendered in Compose by UIKitView) and received one time UIGestureRecognizerStateBegan, two to three times UIGestureRecognizerStateChanged, and one time UIGestureRecognizerStateCancelled event. However, I didn't perform any cancelled operation, yet it was triggered.

Additionally, there's scrolling: For this, I've prepared reproducible code. I suspect it's the same issue, so I'm raising it in this issue together. But if you think these are two separate problems, please feel free to split this issue.

I'm rendering Compose content in a UIKitSheet, which has its own scrolling behavior, and this scrolling seems to interrupt Compose's scrolling. This issue is particularly noticeable in the new version, but it also occurs occasionally in the old version.

BugGestureDemo.zip

you can toggle the compose version in libs.versions.toml

compose-plugin = "1.6.11"
#compose-plugin = "1.7.0-dev1686"

Their behavior is similar: the finger clearly hasn't left the screen, but the code thinks it has.

You can add clickable to the demo I provided, and you'll see that it's triggered click-event during scroll dragging.

Affected platforms

  • iOS

Versions

  • Libraries:
    • Compose Multiplatform version: 1.7.0-dev1686/1.7.0-dev1698
  • Kotlin version: 2.0.0
  • OS version(s) (required for Desktop and iOS issues): 17.5.1
  • OS architecture (x86 or arm64): arm64
  • Device (model or simulator for iOS issues): iphone 12

To Reproduce
Steps to reproduce the behavior:

  1. Click on 'Click Me'
  2. Scroll the UIKit-Sheet
  3. See error

Screenshots

  • 1.6.11
cmp-1.6.11.mp4
  • 1.7.0-dev1686/1.7.0-dev1698
cmp-1.7.0-dev1686.mp4
@Gaubee Gaubee added bug Something isn't working submitted labels Jun 25, 2024
@Gaubee Gaubee changed the title On iOS platforms, Compose gestures conflict with native gestures. On iOS platforms, Compose gestures(scroll or drag) conflict with native gestures. Jun 25, 2024
@Gaubee
Copy link
Author

Gaubee commented Jun 25, 2024

@Levi-Moreira

@elijah-semyonov
Copy link
Contributor

It's a part of meta issue for proper touch interop with native gesture recognizers. The reported problem is just a single facet of it:

#3806
#4818
#3525

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants