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

Prioritise UITapGestureRecognizer on interop views with Cooperative interop mode. Prioritise UIScreenEdgePanGestureRecognizer on ascendant views. #1695

Merged
merged 2 commits into from
Dec 11, 2024

Conversation

elijah-semyonov
Copy link

@elijah-semyonov elijah-semyonov commented Nov 25, 2024

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 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 on UINavigationController should recognize correctly.

@elijah-semyonov elijah-semyonov changed the title Prioritise UITapGestureRecognizer on interop views with Cooperative interop mode. Prioritise UITapGestureRecognizer on interop views with Cooperative interop mode. Prioritise UIScrenEdgePanGestureRecognizer on ascendant views. Nov 25, 2024
@MatkovIvan MatkovIvan requested review from mazunin-v-jb and removed request for MatkovIvan December 11, 2024 12:27
@ASalavei ASalavei changed the title Prioritise UITapGestureRecognizer on interop views with Cooperative interop mode. Prioritise UIScrenEdgePanGestureRecognizer on ascendant views. Prioritise UITapGestureRecognizer on interop views with Cooperative interop mode. Prioritise UIScreenEdgePanGestureRecognizer on ascendant views. Dec 11, 2024
@ASalavei
Copy link
Collaborator

Unfortunately, it fixes the swipe back only partially. STRs:

  • Create UINavigationController with some rootViewController
  • Push Compose View Controller
  • Slowly swipe back, and cancel gesture, by returning to the the current Compose View Controller
  • Perform some interaction with Compose View Controller
  • Try to swipe back again
    Result: Swipe back does not work.

Because the issue considered as critical, and the fix make the overall experience better, I think it worth adding it to the 1.7.2 release. Also, due to complexity of the interop gestures, I would not go with dramatical changes in the frature's code.
The issue should be fixed in 1.8.0.

@MatkovIvan MatkovIvan merged commit d49b3b5 into jb-main Dec 11, 2024
7 checks passed
@MatkovIvan MatkovIvan deleted the es/tap-failure-requirements branch December 11, 2024 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants