Przeglądaj źródła

Bug Fix: Sometimes swipe action made track move too much.

NaotoshiFujita 5 lat temu
rodzic
commit
07b00eade6

Plik diff jest za duży
+ 0 - 0
dist/js/splide.min.js


BIN
dist/js/splide.min.js.gz


+ 5 - 3
src/js/components/drag/index.js

@@ -251,13 +251,15 @@ export default ( Splide, Components ) => {
 
 			if ( absV > options.flickThreshold && Math.abs( info.offset[ axis ] ) < SWIPE_THRESHOLD ) {
 				destination += sign * Math.min( absV * options.flickPower, Layout.width * ( options.flickMaxPages || 1 ) );
-			} else {
-				// Do not allow the track to go to a previous position.
-				destination += sign * Layout.slideWidth / 2;
 			}
 
 			let index = Track.toIndex( destination );
 
+			// Do not allow the track to go to a previous position.
+			if ( index === Splide.index ) {
+				index += Controller.isRtl() ? sign : -sign;
+			}
+
 			if ( ! Splide.is( LOOP ) ) {
 				index = between( index, 0, Controller.edgeIndex );
 			}

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików