Skip to content

Fix iOS Touch popover gesture completion#911

Merged
Vetle444 merged 1 commit into
mainfrom
vefi/bugfix-1844-touch-popover
Jun 29, 2026
Merged

Fix iOS Touch popover gesture completion#911
Vetle444 merged 1 commit into
mainfrom
vefi/bugfix-1844-touch-popover

Conversation

@Vetle444

Copy link
Copy Markdown
Contributor

Description of Change

Fixes an iOS gesture state issue where opening a popover or context menu from Touch.Command could leave scrolling and swipe-back gestures broken after the overlay was dismissed.

The root cause was that the custom TouchEffectTapGestureRecognizer executed the tap command directly from TouchesEnded without first completing/failing its own UIKit recognizer state. If that command opened a popover, UIKit could enter the presentation/dismissal flow while the Touch recognizer was still part of the active touch sequence.

This change makes the Touch recognizer explicitly set Ended, Failed, or Cancelled, and defers command execution to the next main-thread turn so UIKit gets a clean gesture boundary before the popover/context menu opens.

It also removes the previous broad Touch + pan simultaneous-recognition workaround because that was a band-aid: it reduced symptoms around scroll gestures but did not fix the fundamental recognizer lifecycle issue. The existing overlay blocker that prevents taps behind open popovers/context menus is kept, since that behavior is still needed and separate from the pan-state bug.

Todos

  • I have tested on an Android device.
  • I have tested on an iOS device.
  • I have supported accessibility

Copilot AI review requested due to automatic review settings June 29, 2026 08:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses an iOS UIKit gesture lifecycle issue where executing Touch.Command directly from TouchesEnded could leave scroll/swipe-back gestures in a broken state after dismissing a popover/context menu. The approach is to explicitly complete the custom tap recognizer’s state and defer command execution to the next main-thread turn, ensuring UIKit sees a clean gesture boundary before presenting overlays.

Changes:

  • Updated the iOS tap gesture recognizer to explicitly transition to Ended/Failed/Cancelled and defer tap command execution via MainThread.BeginInvokeOnMainThread.
  • Adjusted simultaneous-recognition handling to avoid the previous broad pan workaround while still canceling touch visual state in the relevant pan scenario.
  • Added a changelog entry describing the iOS Touch popover/context menu gesture fix.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/library/DIPS.Mobile.UI/Effects/Touch/iOS/TouchEffectTapGestureRecognizer.cs Completes/terminates the recognizer state explicitly and defers command execution to avoid UIKit gesture-state leakage.
src/library/DIPS.Mobile.UI/Effects/Touch/iOS/TouchEffectGestureRecognizerDelegate.cs Updates pan/touch simultaneous-recognition behavior and narrows when touch cancellation is applied.
CHANGELOG.md Documents the iOS Touch fix in a new patch version entry.

@Vetle444 Vetle444 merged commit 0fd59fe into main Jun 29, 2026
2 checks passed
@Vetle444 Vetle444 deleted the vefi/bugfix-1844-touch-popover branch June 29, 2026 10:04
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.

3 participants