Browse Source

Bug Fix: Should not loop a carousel by `Move#cancel()`.

Naotoshi Fujita 2 years ago
parent
commit
5761e4d844

+ 2 - 2
dist/js/splide.cjs.js

@@ -1293,7 +1293,7 @@ function Layout(Splide2, Components2, options) {
   }
 
   function sliderSize(withoutGap) {
-    return totalSize(Splide2.length - 1, true) - totalSize(0, true) + slideSize(0, withoutGap);
+    return totalSize(Splide2.length - 1) - totalSize(0) + slideSize(0, withoutGap);
   }
 
   function getGap() {
@@ -1490,7 +1490,7 @@ function Move(Splide2, Components2, options) {
   }
 
   function cancel() {
-    translate(getPosition());
+    translate(getPosition(), true);
     Transition.cancel();
   }
 

+ 2 - 2
dist/js/splide.esm.js

@@ -1288,7 +1288,7 @@ function Layout(Splide2, Components2, options) {
   }
 
   function sliderSize(withoutGap) {
-    return totalSize(Splide2.length - 1, true) - totalSize(0, true) + slideSize(0, withoutGap);
+    return totalSize(Splide2.length - 1) - totalSize(0) + slideSize(0, withoutGap);
   }
 
   function getGap() {
@@ -1485,7 +1485,7 @@ function Move(Splide2, Components2, options) {
   }
 
   function cancel() {
-    translate(getPosition());
+    translate(getPosition(), true);
     Transition.cancel();
   }
 

+ 3 - 3
dist/js/splide.js

@@ -4,7 +4,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
 
 /*!
  * Splide.js
- * Version  : 4.0.20
+ * Version  : 4.0.19
  * License  : MIT
  * Copyright: 2022 Naotoshi Fujita
  */
@@ -1286,7 +1286,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
     }
 
     function sliderSize(withoutGap) {
-      return totalSize(Splide2.length - 1, true) - totalSize(0, true) + slideSize(0, withoutGap);
+      return totalSize(Splide2.length - 1) - totalSize(0) + slideSize(0, withoutGap);
     }
 
     function getGap() {
@@ -1483,7 +1483,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
     }
 
     function cancel() {
-      translate(getPosition());
+      translate(getPosition(), true);
       Transition.cancel();
     }
 

File diff suppressed because it is too large
+ 0 - 0
dist/js/splide.min.js


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


File diff suppressed because it is too large
+ 0 - 0
dist/js/splide.min.js.map


+ 1 - 1
src/js/components/Layout/Layout.ts

@@ -228,7 +228,7 @@ export function Layout( Splide: Splide, Components: Components, options: Options
    * @return The width or height of the slider without clones.
    */
   function sliderSize( withoutGap?: boolean ): number {
-    return totalSize( Splide.length - 1, true ) - totalSize( 0, true ) + slideSize( 0, withoutGap );
+    return totalSize( Splide.length - 1 ) - totalSize( 0 ) + slideSize( 0, withoutGap );
   }
 
   /**

+ 1 - 1
src/js/components/Move/Move.ts

@@ -166,7 +166,7 @@ export function Move( Splide: Splide, Components: Components, options: Options )
    * Cancels transition.
    */
   function cancel(): void {
-    translate( getPosition() );
+    translate( getPosition(), true );
     Transition.cancel();
   }
 

Some files were not shown because too many files changed in this diff