Browse Source

Bug Fix: Need to prevent the first touch action.

NaotoshiFujita 3 năm trước cách đây
mục cha
commit
9211c5883e

+ 1 - 1
dist/js/splide-renderer.min.js

@@ -1,6 +1,6 @@
 /*!
  * Splide.js
- * Version  : 3.0.0
+ * Version  : 3.0.1
  * License  : MIT
  * Copyright: 2021 Naotoshi Fujita
  */

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

@@ -1,6 +1,6 @@
 /*!
  * Splide.js
- * Version  : 3.0.0
+ * Version  : 3.0.1
  * License  : MIT
  * Copyright: 2021 Naotoshi Fujita
  */
@@ -1766,7 +1766,8 @@ function Drag(Splide2, Components2, options) {
           Move.cancel();
           Scroll.cancel();
           save(e);
-        } else {
+        }
+        if (e.cancelable) {
           prevent(e, true);
         }
       }

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

@@ -1,6 +1,6 @@
 /*!
  * Splide.js
- * Version  : 3.0.0
+ * Version  : 3.0.1
  * License  : MIT
  * Copyright: 2021 Naotoshi Fujita
  */
@@ -1762,7 +1762,8 @@ function Drag(Splide2, Components2, options) {
           Move.cancel();
           Scroll.cancel();
           save(e);
-        } else {
+        }
+        if (e.cancelable) {
           prevent(e, true);
         }
       }

+ 4 - 2
dist/js/splide.js

@@ -4,7 +4,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
 
 /*!
  * Splide.js
- * Version  : 3.0.0
+ * Version  : 3.0.1
  * License  : MIT
  * Copyright: 2021 Naotoshi Fujita
  */
@@ -2131,7 +2131,9 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
             Move.cancel();
             Scroll.cancel();
             save(e);
-          } else {
+          }
+
+          if (e.cancelable) {
             prevent(e, true);
           }
         }

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/js/splide.js.map


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
dist/js/splide.min.js


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


+ 1 - 1
dist/types/components/Drag/Drag.d.ts.map

@@ -1 +1 @@
-{"version":3,"file":"Drag.d.ts","sourceRoot":"","sources":["Drag.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAKjE;;;;GAIG;AACH,MAAM,WAAW,aAAc,SAAQ,aAAa;IAClD,OAAO,CAAE,QAAQ,EAAE,OAAO,GAAI,IAAI,CAAA;CACnC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,IAAI,CAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,GAAI,aAAa,CA4T9F"}
+{"version":3,"file":"Drag.d.ts","sourceRoot":"","sources":["Drag.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAKjE;;;;GAIG;AACH,MAAM,WAAW,aAAc,SAAQ,aAAa;IAClD,OAAO,CAAE,QAAQ,EAAE,OAAO,GAAI,IAAI,CAAA;CACnC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,IAAI,CAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,GAAI,aAAa,CA8T9F"}

+ 1 - 1
package-lock.json

@@ -1,6 +1,6 @@
 {
   "name": "@splidejs/splide",
-  "version": "3.0.0",
+  "version": "3.0.1",
   "lockfileVersion": 1,
   "requires": true,
   "dependencies": {

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "@splidejs/splide",
-  "version": "3.0.0",
+  "version": "3.0.1",
   "description": "Splide is a lightweight, flexible and accessible slider/carousel. No dependencies, no Lighthouse errors.",
   "author": "Naotoshi Fujita",
   "license": "MIT",

+ 3 - 1
src/js/components/Drag/Drag.ts

@@ -133,7 +133,9 @@ export function Drag( Splide: Splide, Components: Components, options: Options )
           Move.cancel();
           Scroll.cancel();
           save( e );
-        } else {
+        }
+
+        if ( e.cancelable ) {
           prevent( e, true );
         }
       }

+ 9 - 4
src/js/test/php/examples/default.php

@@ -22,17 +22,20 @@ $settings = get_settings();
         type             : 'loop',
         perPage          : 3,
         gap              : '1.5rem',
-        height           : 400,
-        waitForTransition: false,
+        // height           : 400,
+        // waitForTransition: false,
         // direction        : 'ltr',
-        drag             : true,
+        // drag      : true,
+        pagination: false,
+        arrows: false,
         classes: {
           arrows: 'splide__arrows splide__test',
         },
+        slideFocus: false,
         breakpoints: {
           1000: {
             // direction: 'rtl',
-            drag: false,
+            // drag: false,
             perPage: 2,
           }
         },
@@ -72,5 +75,7 @@ $settings = get_settings();
 
 <?php render(); ?>
 
+<pre></pre>
+
 </body>
 </html>

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác