Parcourir la source

Bug Fix: Incorrect snap position.

Naotoshi Fujita il y a 2 ans
Parent
commit
7b398835b7

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

@@ -1293,7 +1293,7 @@ function Layout(Splide2, Components2, options) {
   }
 
   function sliderSize() {
-    return totalSize(Splide2.length - 1, true) - totalSize(0, true) + slideSize(0, true);
+    return totalSize(Splide2.length - 1, true) - totalSize(-1, true);
   }
 
   function getGap() {

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

@@ -1288,7 +1288,7 @@ function Layout(Splide2, Components2, options) {
   }
 
   function sliderSize() {
-    return totalSize(Splide2.length - 1, true) - totalSize(0, true) + slideSize(0, true);
+    return totalSize(Splide2.length - 1, true) - totalSize(-1, true);
   }
 
   function getGap() {

+ 1 - 1
dist/js/splide.js

@@ -1286,7 +1286,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
     }
 
     function sliderSize() {
-      return totalSize(Splide2.length - 1, true) - totalSize(0, true) + slideSize(0, true);
+      return totalSize(Splide2.length - 1, true) - totalSize(-1, true);
     }
 
     function getGap() {

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
dist/js/splide.min.js


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


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
dist/js/splide.min.js.map


+ 2 - 2
package-lock.json

@@ -1,12 +1,12 @@
 {
   "name": "@splidejs/splide",
-  "version": "4.0.21",
+  "version": "4.0.19",
   "lockfileVersion": 2,
   "requires": true,
   "packages": {
     "": {
       "name": "@splidejs/splide",
-      "version": "4.0.21",
+      "version": "4.0.19",
       "license": "MIT",
       "devDependencies": {
         "@babel/core": "^7.18.13",

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

@@ -221,12 +221,11 @@ export function Layout( Splide: Splide, Components: Components, options: Options
 
   /**
    * Returns the slider size without clones before the first slide.
-   * Do not use the clone's size because it's unstable while initializing and refreshing process.
    *
    * @return The width or height of the slider without clones.
    */
   function sliderSize(): number {
-    return totalSize( Splide.length - 1, true ) - totalSize( 0, true ) + slideSize( 0, true );
+    return totalSize( Splide.length - 1, true ) - totalSize( -1, true );
   }
 
   /**

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff