fix(core): swipe to go back gesture has priority over other horizontal swipe gestures (#28304)

Issue number: resolves #28303

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## 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

<!-- If this introduces a breaking change, please describe the impact
and migration path for existing applications below. -->


## 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 <liamdebeasi@users.noreply.github.com>
This commit is contained in:
Alexander Harding
2023-10-09 10:03:23 -05:00
committed by GitHub
parent 00767a02e4
commit d5f0c776df

View File

@ -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,