Skip to content
New issue

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

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

Already on GitHub? # to your account

Prioritise native gestures for specific interop scenarios #1731

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

ASalavei
Copy link
Collaborator

@ASalavei ASalavei commented Dec 12, 2024

Due to large number of changes in between the commit and current state (which included the MR), the optimal solutions looks to rewrite original commit in Objective-C.

Original description:

Before that change taps on interop views with cooperative mode would be discarded by compose, which expects non-discrete gesture holding on a point before failing and redirecting touches sequence to the interop view.

The requirement of holding ultimately made the tap gesture impossible due to its requirement of being a short press/release sequence, which contradicts the compose heuristics.

This scenario is fixed in this PR by allowing precedence of UITapGestureRecognizer over other recognisers.

Since most of the native tap/double tap interactions are built on top of UITapGestureRecognizer it should improve the UX for default interop properties with stable constructor setting the interaction mode to be Cooperative.

Coincidentally this change inspired a cheap fix for interactive pop bugs.

Resolves https://youtrack.jetbrains.com/issue/CMP-6683
Fixes https://youtrack.jetbrains.com/issue/CMP-6622/Gestures-dont-work-on-native-ios-view-embedded-with-UIKitView-for-compose-1.7.0-beta01

Demo:

Screen.Recording.2024-11-25.at.14.18.25.mov

Testing

  • Taps on interop views with cooperative interaction mode are properly registered now and processed by native UITapGesture recogniser attached to that view.
  • Interactive pop (Swipe to go back) on UINavigationController should not get stuck in an awkward state preventing the gesture.

This should be tested by QA

Release Notes

Fixes - iOS

  • Taps should be properly registered on interop views with UIKitInteropInteractionMode.Cooperative interaction mode.
  • Interactive pop (swipe to go back) on UINavigationController should recognize correctly.

@ASalavei ASalavei merged commit 35e10c4 into release/1.7.2 Dec 13, 2024
5 of 6 checks passed
@ASalavei ASalavei deleted the andrei.salavei/prioratize-native-gestures branch December 13, 2024 11:03
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants