Skip to content

Commit d841428

Browse files
committed
fix(core): fix touchReleaseOnEdges in RTL
fixes #7179
1 parent 16818e2 commit d841428

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/core/events/onTouchMove.mjs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ export default function onTouchMove(event) {
5757
}
5858
return;
5959
}
60-
6160
if (params.touchReleaseOnEdges && !params.loop) {
6261
if (swiper.isVertical()) {
6362
// Vertical
@@ -70,8 +69,15 @@ export default function onTouchMove(event) {
7069
return;
7170
}
7271
} else if (
73-
(pageX < touches.startX && swiper.translate <= swiper.maxTranslate()) ||
74-
(pageX > touches.startX && swiper.translate >= swiper.minTranslate())
72+
rtl &&
73+
((pageX > touches.startX && -swiper.translate <= swiper.maxTranslate()) ||
74+
(pageX < touches.startX && -swiper.translate >= swiper.minTranslate()))
75+
) {
76+
return;
77+
} else if (
78+
!rtl &&
79+
((pageX < touches.startX && swiper.translate <= swiper.maxTranslate()) ||
80+
(pageX > touches.startX && swiper.translate >= swiper.minTranslate()))
7581
) {
7682
return;
7783
}

0 commit comments

Comments
 (0)