Skip to content

fix(ios): keep a double tap's second touch from iPadOS 26's window double-tap interaction - #2387

Merged
houko merged 1 commit into
mainfrom
fix/ipad-double-tap
Nov 25, 2026
Merged

houko merged 1 commit into
mainfrom
fix/ipad-double-tap

Conversation

@houko

@houko houko commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

On iPadOS 26, a double tap on a pressable view reports only one press: OnPress never gets Clicks: 2. apple-simulator's TestPressesCountConsecutiveClicks failed with press counts = [1 1], want [1 2 1] every time it ran on the iPad Pro 13-inch (M5) simulator, and passed on an iPhone and on an iOS 18.4 iPad.

Instrumenting touchesBegan/touchesEnded/touchesCancelled on CI showed the second tap began with tapCount 2 and then went to touchesCancelled, cancelled by a recognizer UIKit puts on every window on iPadOS 26:

cancelled view=true
  recognizer <NsgoTouchTracker ...; state = Failed; cancelsTouchesInView = NO; view = <NsgoSurface ...>>
  recognizer <_UIDoubleTapInteractionGestureRecognizer ... (com.apple.UIKit._UIDoubleTapInteraction.tap); state = Ended; view = <NsgoWindow ...>; target= <(action=_handleTap:, target=<_UIDoubleTapInteraction ...>)>> cancelsTouches=true

So the double-tap interaction recognizes the double tap and, as cancelsTouchesInView defaults to YES, cancels the view's touches. A user's double tap on iPad loses its second click the same way.

NsgoWindow.sendEvent: now turns that recognizer's cancelsTouchesInView off (matched by its name) before delivering each touch event. The interaction still recognizes and runs; the view hears the tap end and reports both clicks. With the same change applied on CI, the test reported [1 2 1] on the iPadOS 26 iPad.

As the regression test, apple-simulator now also runs TestPressesCountConsecutiveClicks on its iPad. The interaction document records the behavior.

Verification

  • go tool nsgo check -target ios_simulator,ios: passes.
  • TestPressesCountConsecutiveClicks, TestPanEndsAtTheLastOffset, TestPinchReportsScaleAndPhase and TestPressAtFindsZoomedScrollContent on local iOS 18.4 iPhone 16 and iPad Air 13-inch (M3) simulators: pass.
  • test.yml dispatched on this branch (run 45625535121): every job passed, apple-simulator included, with TestPressesCountConsecutiveClicks passing on the iPad Pro 13-inch (M5) iPadOS 26 simulator, where it failed every time before.

@houko
houko force-pushed the fix/ipad-double-tap branch from b7237fe to 3e9bcf7 Compare November 25, 2026 13:00
@github-actions github-actions Bot added size/S bug Something isn't working documentation Improvements or additions to documentation iOS ci labels Nov 25, 2026
…uble-tap interaction

iPadOS 26 adds _UIDoubleTapInteraction to every window. Its recognizer (com.apple.UIKit._UIDoubleTapInteraction.tap) recognizes a double tap anywhere and cancels the touches in the view, so the second tap reached touchesCancelled instead of touchesEnded and OnPress never reported Clicks 2. NsgoWindow now turns off that recognizer's cancelsTouchesInView before delivering each touch event: the interaction still runs, and the view hears the tap end. apple-simulator runs TestPressesCountConsecutiveClicks on the iPad as its regression test.
@houko
houko force-pushed the fix/ipad-double-tap branch from 3e9bcf7 to 1ccc7be Compare November 25, 2026 13:37
@houko
houko merged commit 9c6fe5e into main Nov 25, 2026
41 checks passed
@houko
houko deleted the fix/ipad-double-tap branch November 25, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ci documentation Improvements or additions to documentation iOS size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant