Open Gaubee opened 1 week ago
@Levi-Moreira
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:
https://github.com/JetBrains/compose-multiplatform/issues/3806 https://github.com/JetBrains/compose-multiplatform/issues/4818 https://github.com/JetBrains/compose-multiplatform/issues/3525
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
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
Versions
To Reproduce Steps to reproduce the behavior:
Screenshots
https://github.com/JetBrains/compose-multiplatform/assets/2151644/eed91e2c-376d-4225-b26d-b44a28fa9f99
https://github.com/JetBrains/compose-multiplatform/assets/2151644/2d87c18a-e119-4c15-81a6-44d33eb7d976