Skip to content

Commit bdaf093

Browse files
Vetle FinstadVetle Finstad
authored andcommitted
Fix iOS Touch popover gesture completion
1 parent 5b6bfcf commit bdaf093

3 files changed

Lines changed: 16 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## [60.2.18]
2+
- [Touch][iOS] Fixed popovers and context menus opened from `Touch.Command` breaking scrolling and swipe-back gestures after dismissal.
3+
14
## [60.2.17]
25
- [Touch][iOS] Fixed scroll gestures on tappable rows getting stuck after dismissing context menus or picker popovers, and prevented taps behind open overlays from activating touch commands.
36

src/library/DIPS.Mobile.UI/Effects/Touch/iOS/TouchEffectGestureRecognizerDelegate.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ public override bool ShouldRecognizeSimultaneously(UIGestureRecognizer gestureRe
4747
UIGestureRecognizer otherGestureRecognizer)
4848
{
4949
if (gestureRecognizer is TouchEffectTapGestureRecognizer touchGesture &&
50-
otherGestureRecognizer is UIPanGestureRecognizer)
50+
otherGestureRecognizer is UIPanGestureRecognizer &&
51+
otherGestureRecognizer.State == UIGestureRecognizerState.Began)
5152
{
5253
TouchPlatformEffect.HandleTouch(UIGestureRecognizerState.Cancelled, ref touchGesture.m_currentState,
5354
gestureRecognizer.View);
54-
return false;
5555
}
5656

5757
return true;

src/library/DIPS.Mobile.UI/Effects/Touch/iOS/TouchEffectTapGestureRecognizer.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,26 @@ public override void TouchesBegan(NSSet touches, UIEvent evt)
4747
public override void TouchesEnded(NSSet touches, UIEvent evt)
4848
{
4949
base.TouchesEnded(touches, evt);
50-
51-
if(!m_longPressDetected && m_currentState is not UIGestureRecognizerState.Cancelled)
52-
m_onTap.Invoke();
50+
51+
var shouldInvokeTap = !m_longPressDetected && m_currentState is not UIGestureRecognizerState.Cancelled;
5352

5453
TouchPlatformEffect.HandleTouch(UIGestureRecognizerState.Ended, ref m_currentState, m_uiView);
5554
m_longPressDetected = false;
55+
56+
State = shouldInvokeTap ? UIGestureRecognizerState.Ended : UIGestureRecognizerState.Failed;
57+
58+
if (shouldInvokeTap)
59+
{
60+
MainThread.BeginInvokeOnMainThread(m_onTap);
61+
}
5662
}
5763

5864
public override void TouchesCancelled(NSSet touches, UIEvent evt)
5965
{
6066
base.TouchesCancelled(touches, evt);
6167

6268
TouchPlatformEffect.HandleTouch(UIGestureRecognizerState.Cancelled, ref m_currentState, m_uiView);
69+
State = UIGestureRecognizerState.Cancelled;
6370
m_longPressDetected = false;
6471
}
6572

@@ -76,6 +83,7 @@ public override void TouchesMoved(NSSet touches, UIEvent evt)
7683
{
7784
TouchPlatformEffect.HandleTouch(UIGestureRecognizerState.Cancelled, ref m_currentState, m_uiView);
7885
m_isCancelled = true;
86+
State = UIGestureRecognizerState.Failed;
7987
}
8088

8189
base.TouchesMoved(touches, evt);

0 commit comments

Comments
 (0)