From d5f0c776dfb5cb40b8119c596805dad3adb621e0 Mon Sep 17 00:00:00 2001 From: Alexander Harding <2166114+aeharding@users.noreply.github.com> Date: Mon, 9 Oct 2023 10:03:23 -0500 Subject: [PATCH] fix(core): swipe to go back gesture has priority over other horizontal swipe gestures (#28304) Issue number: resolves #28303 --------- ## What is the current behavior? - Swipe back gesture is inconsistently clobbered by ion-item-sliding's gesture. ## What is the new behavior? - Swipe back gesture now has a higher priority than ion-item-sliding - - ## Does this introduce a breaking change? - [ ] Yes - [X] No ## Other information This patch has been in use in [Voyager](https://github.com/aeharding/voyager) for the past couple months to great success! --------- Co-authored-by: Liam DeBeasi --- core/src/utils/gesture/swipe-back.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/utils/gesture/swipe-back.ts b/core/src/utils/gesture/swipe-back.ts index 2a8da3abd3..2be8ebdff7 100644 --- a/core/src/utils/gesture/swipe-back.ts +++ b/core/src/utils/gesture/swipe-back.ts @@ -79,7 +79,11 @@ export const createSwipeBackGesture = ( return createGesture({ el, gestureName: 'goback-swipe', - gesturePriority: 40, + /** + * Swipe to go back should have priority over other horizontal swipe + * gestures. These gestures have a priority of 100 which is why 101 was chosen here. + */ + gesturePriority: 101, threshold: 10, canStart, onStart: onStartHandler,