Conversation
hggzm
added a commit
to hggzm/Teams-AdaptiveCards-Mobile
that referenced
this pull request
Mar 27, 2026
iOS 26 introduced a new Gestures framework that re-delivers touchesEnded:withEvent: twice for the same physical tap once through the normal UIKit dispatch path, and a second time via a deferred CoreFoundation run-loop callback with a new UIEvent object pointer. In ACRContentStackView, touchesEnded calls doSelectAction unconditionally, so Action.ToggleVisibility fired twice per tap opening the card then immediately closing it again. Fix: - Added BOOL _hasFiredActionForCurrentTouch ivar - touchesBegan resets the flag at the start of each new touch sequence - touchesEnded checks the flag before firing skips re-delivery - Added touchesCancelled handler to reset flag and forward event Includes 6 headless unit tests (ACRContentStackViewDoubleTouchTests.mm): - testSingleTouchFiresOnce - testDoubleTouchesEndedFiresOnlyOnce (core iOS 26 scenario) - testTouchesCancelledResetsGuard - testTwoSeparateTouchSequencesBothFire - testTripleTouchesEndedFiresOnlyOnce - testNoSelectActionTargetNoFire Validated on iOS 26.2 simulator (Xcode 16.4, macos-15 runner).
hggzm
force-pushed
the
users/hggzm/clean/fix-ios26-toggle-double-fire
branch
from
March 27, 2026 14:44
ab39648 to
bf7064b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Action.ToggleVisibility fires twice on iOS 26, causing toggled content to open then immediately collapse.
iOS 26 introduced a new Gestures framework that re-delivers
touchesEnded:withEvent:twice for the same physical tap:AXPApplication.sendEvent:)Critically, the second delivery uses a new UIEvent object (different pointer), so simple event pointer deduplication doesn't work.
In
ACRContentStackView,touchesEnded:withEvent:callsdoSelectActionunconditionally, soAction.ToggleVisibilityfires twice per tap — opening the card then immediately closing it again.Customer Impact
This blocks Fast Retailing's ServiceNow Now Assist rollout (100+ stores worldwide). Their card uses
ColumnSet.selectActionwithAction.ToggleVisibilityto expand/collapse a "Sources" section. Microsoft support case: TrackingID# 2603110030008961.Version Matrix (Customer-Reported)
Same card works on Android, Desktop, Web.
Fix
In
ACRContentStackView.mm:BOOL _hasFiredActionForCurrentTouchivartouchesBegan:withEvent:resets the flag toNOat the start of each new touch sequencetouchesEnded:withEvent:checks the flag before firing — skips on re-delivery, sets it toYESon first firetouchesCancelled:withEvent:handler to reset the flag and forward the eventWhy This Fix Is Safe
touchesBegan→touchesEnded/touchesCancelled)touchesCancelledproperly resets the flag to avoid stuck stateHow Verified
com.apple.CoreSimulator.SimRuntime.iOS-26-2)testToggleVisibilityDoubleFireUI test:Action.ToggleVisibility.jsoncard