Browse Source

Bug Fix: Safari on iOS 15 triggers the window resize event when swiping action resizes the bottom nav bar.

NaotoshiFujita 3 years ago
parent
commit
e428e1383a

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

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

+ 18 - 12
dist/js/splide.cjs.js

@@ -1,6 +1,6 @@
 /*!
 /*!
  * Splide.js
  * Splide.js
- * Version  : 3.1.8
+ * Version  : 3.1.9
  * License  : MIT
  * License  : MIT
  * Copyright: 2021 Naotoshi Fujita
  * Copyright: 2021 Naotoshi Fujita
  */
  */
@@ -1173,9 +1173,11 @@ function Move(Splide2, Components2, options) {
     removeAttribute(list, "style");
     removeAttribute(list, "style");
   }
   }
   function reposition() {
   function reposition() {
-    Components2.Scroll.cancel();
-    jump(Splide2.index);
-    emit(EVENT_REPOSITIONED);
+    if (!Components2.Drag.isDragging()) {
+      Components2.Scroll.cancel();
+      jump(Splide2.index);
+      emit(EVENT_REPOSITIONED);
+    }
   }
   }
   function move(dest, index, prev, callback) {
   function move(dest, index, prev, callback) {
     if (!isBusy()) {
     if (!isBusy()) {
@@ -1741,7 +1743,7 @@ function Drag(Splide2, Components2, options) {
   let prevBaseEvent;
   let prevBaseEvent;
   let lastEvent;
   let lastEvent;
   let isFree;
   let isFree;
-  let isDragging;
+  let dragging;
   let hasExceeded = false;
   let hasExceeded = false;
   let clickPrevented;
   let clickPrevented;
   let disabled;
   let disabled;
@@ -1785,7 +1787,7 @@ function Drag(Splide2, Components2, options) {
     }
     }
     lastEvent = e;
     lastEvent = e;
     if (e.cancelable) {
     if (e.cancelable) {
-      if (isDragging) {
+      if (dragging) {
         const expired = timeOf(e) - timeOf(baseEvent) > LOG_INTERVAL;
         const expired = timeOf(e) - timeOf(baseEvent) > LOG_INTERVAL;
         const exceeded = hasExceeded !== (hasExceeded = exceededLimit());
         const exceeded = hasExceeded !== (hasExceeded = exceededLimit());
         if (expired || exceeded) {
         if (expired || exceeded) {
@@ -1799,7 +1801,7 @@ function Drag(Splide2, Components2, options) {
         const diff = abs(coordOf(e) - coordOf(baseEvent));
         const diff = abs(coordOf(e) - coordOf(baseEvent));
         let { dragMinThreshold: thresholds } = options;
         let { dragMinThreshold: thresholds } = options;
         thresholds = isObject(thresholds) ? thresholds : { mouse: 0, touch: +thresholds || 10 };
         thresholds = isObject(thresholds) ? thresholds : { mouse: 0, touch: +thresholds || 10 };
-        isDragging = diff > (isTouchEvent(e) ? thresholds.touch : thresholds.mouse);
+        dragging = diff > (isTouchEvent(e) ? thresholds.touch : thresholds.mouse);
         if (isSliderDirection()) {
         if (isSliderDirection()) {
           prevent(e);
           prevent(e);
         }
         }
@@ -1810,7 +1812,7 @@ function Drag(Splide2, Components2, options) {
     unbind(target, POINTER_MOVE_EVENTS, onPointerMove);
     unbind(target, POINTER_MOVE_EVENTS, onPointerMove);
     unbind(target, POINTER_UP_EVENTS, onPointerUp);
     unbind(target, POINTER_UP_EVENTS, onPointerUp);
     if (lastEvent) {
     if (lastEvent) {
-      if (isDragging || e.cancelable && isSliderDirection()) {
+      if (dragging || e.cancelable && isSliderDirection()) {
         const velocity = computeVelocity(e);
         const velocity = computeVelocity(e);
         const destination = computeDestination(velocity);
         const destination = computeDestination(velocity);
         if (isFree) {
         if (isFree) {
@@ -1824,7 +1826,7 @@ function Drag(Splide2, Components2, options) {
       }
       }
       emit(EVENT_DRAGGED);
       emit(EVENT_DRAGGED);
     }
     }
-    isDragging = false;
+    dragging = false;
   }
   }
   function save(e) {
   function save(e) {
     prevBaseEvent = baseEvent;
     prevBaseEvent = baseEvent;
@@ -1862,18 +1864,22 @@ function Drag(Splide2, Components2, options) {
   function timeOf(e) {
   function timeOf(e) {
     return e.timeStamp;
     return e.timeStamp;
   }
   }
+  function constrain(diff) {
+    return diff / (hasExceeded && Splide2.is(SLIDE) ? FRICTION : 1);
+  }
   function isTouchEvent(e) {
   function isTouchEvent(e) {
     return typeof TouchEvent !== "undefined" && e instanceof TouchEvent;
     return typeof TouchEvent !== "undefined" && e instanceof TouchEvent;
   }
   }
-  function constrain(diff) {
-    return diff / (hasExceeded && Splide2.is(SLIDE) ? FRICTION : 1);
+  function isDragging() {
+    return dragging;
   }
   }
   function disable(value) {
   function disable(value) {
     disabled = value;
     disabled = value;
   }
   }
   return {
   return {
     mount,
     mount,
-    disable
+    disable,
+    isDragging
   };
   };
 }
 }
 
 

+ 18 - 12
dist/js/splide.esm.js

@@ -1,6 +1,6 @@
 /*!
 /*!
  * Splide.js
  * Splide.js
- * Version  : 3.1.8
+ * Version  : 3.1.9
  * License  : MIT
  * License  : MIT
  * Copyright: 2021 Naotoshi Fujita
  * Copyright: 2021 Naotoshi Fujita
  */
  */
@@ -1169,9 +1169,11 @@ function Move(Splide2, Components2, options) {
     removeAttribute(list, "style");
     removeAttribute(list, "style");
   }
   }
   function reposition() {
   function reposition() {
-    Components2.Scroll.cancel();
-    jump(Splide2.index);
-    emit(EVENT_REPOSITIONED);
+    if (!Components2.Drag.isDragging()) {
+      Components2.Scroll.cancel();
+      jump(Splide2.index);
+      emit(EVENT_REPOSITIONED);
+    }
   }
   }
   function move(dest, index, prev, callback) {
   function move(dest, index, prev, callback) {
     if (!isBusy()) {
     if (!isBusy()) {
@@ -1737,7 +1739,7 @@ function Drag(Splide2, Components2, options) {
   let prevBaseEvent;
   let prevBaseEvent;
   let lastEvent;
   let lastEvent;
   let isFree;
   let isFree;
-  let isDragging;
+  let dragging;
   let hasExceeded = false;
   let hasExceeded = false;
   let clickPrevented;
   let clickPrevented;
   let disabled;
   let disabled;
@@ -1781,7 +1783,7 @@ function Drag(Splide2, Components2, options) {
     }
     }
     lastEvent = e;
     lastEvent = e;
     if (e.cancelable) {
     if (e.cancelable) {
-      if (isDragging) {
+      if (dragging) {
         const expired = timeOf(e) - timeOf(baseEvent) > LOG_INTERVAL;
         const expired = timeOf(e) - timeOf(baseEvent) > LOG_INTERVAL;
         const exceeded = hasExceeded !== (hasExceeded = exceededLimit());
         const exceeded = hasExceeded !== (hasExceeded = exceededLimit());
         if (expired || exceeded) {
         if (expired || exceeded) {
@@ -1795,7 +1797,7 @@ function Drag(Splide2, Components2, options) {
         const diff = abs(coordOf(e) - coordOf(baseEvent));
         const diff = abs(coordOf(e) - coordOf(baseEvent));
         let { dragMinThreshold: thresholds } = options;
         let { dragMinThreshold: thresholds } = options;
         thresholds = isObject(thresholds) ? thresholds : { mouse: 0, touch: +thresholds || 10 };
         thresholds = isObject(thresholds) ? thresholds : { mouse: 0, touch: +thresholds || 10 };
-        isDragging = diff > (isTouchEvent(e) ? thresholds.touch : thresholds.mouse);
+        dragging = diff > (isTouchEvent(e) ? thresholds.touch : thresholds.mouse);
         if (isSliderDirection()) {
         if (isSliderDirection()) {
           prevent(e);
           prevent(e);
         }
         }
@@ -1806,7 +1808,7 @@ function Drag(Splide2, Components2, options) {
     unbind(target, POINTER_MOVE_EVENTS, onPointerMove);
     unbind(target, POINTER_MOVE_EVENTS, onPointerMove);
     unbind(target, POINTER_UP_EVENTS, onPointerUp);
     unbind(target, POINTER_UP_EVENTS, onPointerUp);
     if (lastEvent) {
     if (lastEvent) {
-      if (isDragging || e.cancelable && isSliderDirection()) {
+      if (dragging || e.cancelable && isSliderDirection()) {
         const velocity = computeVelocity(e);
         const velocity = computeVelocity(e);
         const destination = computeDestination(velocity);
         const destination = computeDestination(velocity);
         if (isFree) {
         if (isFree) {
@@ -1820,7 +1822,7 @@ function Drag(Splide2, Components2, options) {
       }
       }
       emit(EVENT_DRAGGED);
       emit(EVENT_DRAGGED);
     }
     }
-    isDragging = false;
+    dragging = false;
   }
   }
   function save(e) {
   function save(e) {
     prevBaseEvent = baseEvent;
     prevBaseEvent = baseEvent;
@@ -1858,18 +1860,22 @@ function Drag(Splide2, Components2, options) {
   function timeOf(e) {
   function timeOf(e) {
     return e.timeStamp;
     return e.timeStamp;
   }
   }
+  function constrain(diff) {
+    return diff / (hasExceeded && Splide2.is(SLIDE) ? FRICTION : 1);
+  }
   function isTouchEvent(e) {
   function isTouchEvent(e) {
     return typeof TouchEvent !== "undefined" && e instanceof TouchEvent;
     return typeof TouchEvent !== "undefined" && e instanceof TouchEvent;
   }
   }
-  function constrain(diff) {
-    return diff / (hasExceeded && Splide2.is(SLIDE) ? FRICTION : 1);
+  function isDragging() {
+    return dragging;
   }
   }
   function disable(value) {
   function disable(value) {
     disabled = value;
     disabled = value;
   }
   }
   return {
   return {
     mount,
     mount,
-    disable
+    disable,
+    isDragging
   };
   };
 }
 }
 
 

+ 19 - 12
dist/js/splide.js

@@ -4,7 +4,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
 
 
 /*!
 /*!
  * Splide.js
  * Splide.js
- * Version  : 3.1.8
+ * Version  : 3.1.9
  * License  : MIT
  * License  : MIT
  * Copyright: 2021 Naotoshi Fujita
  * Copyright: 2021 Naotoshi Fujita
  */
  */
@@ -1390,9 +1390,11 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
     }
     }
 
 
     function reposition() {
     function reposition() {
-      Components2.Scroll.cancel();
-      jump(Splide2.index);
-      emit(EVENT_REPOSITIONED);
+      if (!Components2.Drag.isDragging()) {
+        Components2.Scroll.cancel();
+        jump(Splide2.index);
+        emit(EVENT_REPOSITIONED);
+      }
     }
     }
 
 
     function move(dest, index, prev, callback) {
     function move(dest, index, prev, callback) {
@@ -2096,7 +2098,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
     var prevBaseEvent;
     var prevBaseEvent;
     var lastEvent;
     var lastEvent;
     var isFree;
     var isFree;
-    var isDragging;
+    var dragging;
     var hasExceeded = false;
     var hasExceeded = false;
     var clickPrevented;
     var clickPrevented;
     var disabled;
     var disabled;
@@ -2149,7 +2151,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
       lastEvent = e;
       lastEvent = e;
 
 
       if (e.cancelable) {
       if (e.cancelable) {
-        if (isDragging) {
+        if (dragging) {
           var expired = timeOf(e) - timeOf(baseEvent) > LOG_INTERVAL;
           var expired = timeOf(e) - timeOf(baseEvent) > LOG_INTERVAL;
           var exceeded = hasExceeded !== (hasExceeded = exceededLimit());
           var exceeded = hasExceeded !== (hasExceeded = exceededLimit());
 
 
@@ -2168,7 +2170,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
             mouse: 0,
             mouse: 0,
             touch: +thresholds || 10
             touch: +thresholds || 10
           };
           };
-          isDragging = diff > (isTouchEvent(e) ? thresholds.touch : thresholds.mouse);
+          dragging = diff > (isTouchEvent(e) ? thresholds.touch : thresholds.mouse);
 
 
           if (isSliderDirection()) {
           if (isSliderDirection()) {
             prevent(e);
             prevent(e);
@@ -2182,7 +2184,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
       unbind(target, POINTER_UP_EVENTS, onPointerUp);
       unbind(target, POINTER_UP_EVENTS, onPointerUp);
 
 
       if (lastEvent) {
       if (lastEvent) {
-        if (isDragging || e.cancelable && isSliderDirection()) {
+        if (dragging || e.cancelable && isSliderDirection()) {
           var velocity = computeVelocity(e);
           var velocity = computeVelocity(e);
           var destination = computeDestination(velocity);
           var destination = computeDestination(velocity);
 
 
@@ -2200,7 +2202,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
         emit(EVENT_DRAGGED);
         emit(EVENT_DRAGGED);
       }
       }
 
 
-      isDragging = false;
+      dragging = false;
     }
     }
 
 
     function save(e) {
     function save(e) {
@@ -2248,12 +2250,16 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
       return e.timeStamp;
       return e.timeStamp;
     }
     }
 
 
+    function constrain(diff) {
+      return diff / (hasExceeded && Splide2.is(SLIDE) ? FRICTION : 1);
+    }
+
     function isTouchEvent(e) {
     function isTouchEvent(e) {
       return typeof TouchEvent !== "undefined" && e instanceof TouchEvent;
       return typeof TouchEvent !== "undefined" && e instanceof TouchEvent;
     }
     }
 
 
-    function constrain(diff) {
-      return diff / (hasExceeded && Splide2.is(SLIDE) ? FRICTION : 1);
+    function isDragging() {
+      return dragging;
     }
     }
 
 
     function disable(value) {
     function disable(value) {
@@ -2262,7 +2268,8 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
 
 
     return {
     return {
       mount: mount,
       mount: mount,
-      disable: disable
+      disable: disable,
+      isDragging: isDragging
     };
     };
   }
   }
 
 

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


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


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


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

@@ -7,6 +7,7 @@ import { BaseComponent, Components, Options } from '../../types';
  */
  */
 export interface DragComponent extends BaseComponent {
 export interface DragComponent extends BaseComponent {
     disable(disabled: boolean): void;
     disable(disabled: boolean): void;
+    isDragging(): boolean;
 }
 }
 /**
 /**
  * The component for dragging the slider.
  * The component for dragging the slider.

+ 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,CAwT9F"}
+{"version":3,"file":"Drag.d.ts","sourceRoot":"","sources":["Drag.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,C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,OAAO,GAAG,SAAS,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAI,OAAO,CAAC;CACxE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,IAAI,CAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,GAAI,aAAa,CAsQ9F"}

+ 1 - 1
package-lock.json

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

+ 1 - 1
package.json

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

+ 24 - 13
src/js/components/Drag/Drag.ts

@@ -13,7 +13,8 @@ import { FRICTION, LOG_INTERVAL, POINTER_DOWN_EVENTS, POINTER_MOVE_EVENTS, POINT
  * @since 3.0.0
  * @since 3.0.0
  */
  */
 export interface DragComponent extends BaseComponent {
 export interface DragComponent extends BaseComponent {
-  disable( disabled: boolean ): void
+  disable( disabled: boolean ): void;
+  isDragging(): boolean;
 }
 }
 
 
 /**
 /**
@@ -63,7 +64,7 @@ export function Drag( Splide: Splide, Components: Components, options: Options )
   /**
   /**
    * Indicates whether the user is dragging the slider or not.
    * Indicates whether the user is dragging the slider or not.
    */
    */
-  let isDragging: boolean;
+  let dragging: boolean;
 
 
   /**
   /**
    * Indicates whether the slider exceeds limits or not.
    * Indicates whether the slider exceeds limits or not.
@@ -151,7 +152,7 @@ export function Drag( Splide: Splide, Components: Components, options: Options )
     lastEvent = e;
     lastEvent = e;
 
 
     if ( e.cancelable ) {
     if ( e.cancelable ) {
-      if ( isDragging ) {
+      if ( dragging ) {
         const expired  = timeOf( e ) - timeOf( baseEvent ) > LOG_INTERVAL;
         const expired  = timeOf( e ) - timeOf( baseEvent ) > LOG_INTERVAL;
         const exceeded = hasExceeded !== ( hasExceeded = exceededLimit() );
         const exceeded = hasExceeded !== ( hasExceeded = exceededLimit() );
 
 
@@ -167,7 +168,7 @@ export function Drag( Splide: Splide, Components: Components, options: Options )
         const diff = abs( coordOf( e ) - coordOf( baseEvent ) );
         const diff = abs( coordOf( e ) - coordOf( baseEvent ) );
         let { dragMinThreshold: thresholds } = options;
         let { dragMinThreshold: thresholds } = options;
         thresholds = isObject( thresholds ) ? thresholds : { mouse: 0, touch: +thresholds || 10 };
         thresholds = isObject( thresholds ) ? thresholds : { mouse: 0, touch: +thresholds || 10 };
-        isDragging = diff > ( isTouchEvent( e ) ? thresholds.touch : thresholds.mouse );
+        dragging   = diff > ( isTouchEvent( e ) ? thresholds.touch : thresholds.mouse );
 
 
         if ( isSliderDirection() ) {
         if ( isSliderDirection() ) {
           prevent( e );
           prevent( e );
@@ -188,7 +189,7 @@ export function Drag( Splide: Splide, Components: Components, options: Options )
     unbind( target, POINTER_UP_EVENTS, onPointerUp );
     unbind( target, POINTER_UP_EVENTS, onPointerUp );
 
 
     if ( lastEvent ) {
     if ( lastEvent ) {
-      if ( isDragging || ( e.cancelable && isSliderDirection() ) ) {
+      if ( dragging || ( e.cancelable && isSliderDirection() ) ) {
         const velocity    = computeVelocity( e );
         const velocity    = computeVelocity( e );
         const destination = computeDestination( velocity );
         const destination = computeDestination( velocity );
 
 
@@ -206,7 +207,7 @@ export function Drag( Splide: Splide, Components: Components, options: Options )
       emit( EVENT_DRAGGED );
       emit( EVENT_DRAGGED );
     }
     }
 
 
-    isDragging = false;
+    dragging = false;
   }
   }
 
 
   /**
   /**
@@ -303,6 +304,18 @@ export function Drag( Splide: Splide, Components: Components, options: Options )
     return e.timeStamp;
     return e.timeStamp;
   }
   }
 
 
+  /**
+   * Reduces the distance to move by the predefined friction.
+   * This does nothing when the slider type is not `slide`, or the position is inside borders.
+   *
+   * @param diff - Diff to constrain.
+   *
+   * @return The constrained diff.
+   */
+  function constrain( diff: number ): number {
+    return diff / ( hasExceeded && Splide.is( SLIDE ) ? FRICTION : 1 );
+  }
+
   /**
   /**
    * Checks if the provided event is TouchEvent or MouseEvent.
    * Checks if the provided event is TouchEvent or MouseEvent.
    *
    *
@@ -315,15 +328,12 @@ export function Drag( Splide: Splide, Components: Components, options: Options )
   }
   }
 
 
   /**
   /**
-   * Reduces the distance to move by the predefined friction.
-   * This does nothing when the slider type is not `slide`, or the position is inside borders.
+   * Checks if now the user is dragging the slider or not.
    *
    *
-   * @param diff - Diff to constrain.
-   *
-   * @return The constrained diff.
+   * @return `true` if the user is dragging the slider or otherwise `false`.
    */
    */
-  function constrain( diff: number ): number {
-    return diff / ( hasExceeded && Splide.is( SLIDE ) ? FRICTION : 1 );
+  function isDragging(): boolean {
+    return dragging;
   }
   }
 
 
   /**
   /**
@@ -338,5 +348,6 @@ export function Drag( Splide: Splide, Components: Components, options: Options )
   return {
   return {
     mount,
     mount,
     disable,
     disable,
+    isDragging,
   };
   };
 }
 }

+ 8 - 5
src/js/components/Move/Move.ts

@@ -72,13 +72,16 @@ export function Move( Splide: Splide, Components: Components, options: Options )
 
 
   /**
   /**
    * Repositions the slider.
    * Repositions the slider.
-   * This must be called before the Slide component checks the visibility.
-   * Do not call `cancel()` here because LazyLoad may emit resize while transitioning.
+   * - This must be called before the Slide component checks the visibility.
+   * - Do not call `cancel()` here because LazyLoad may emit resize while transitioning.
+   * - iOS Safari emits window resize event while the user swipes the slider because of the bottom bar.
    */
    */
   function reposition(): void {
   function reposition(): void {
-    Components.Scroll.cancel();
-    jump( Splide.index );
-    emit( EVENT_REPOSITIONED );
+    if ( ! Components.Drag.isDragging() ) {
+      Components.Scroll.cancel();
+      jump( Splide.index );
+      emit( EVENT_REPOSITIONED );
+    }
   }
   }
 
 
   /**
   /**

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